Skip to content

Commit

Permalink
Revert "gpio: gpio-xilinx: Add xgpio_xlate function"
Browse files Browse the repository at this point in the history
This reverts commit 4eb5574.
In the description of the commit itself specifies the backward
compatibility will be reverted 2022.2.
So reverting the same.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
State: Unupstreamable
  • Loading branch information
Shubhrajyoti Datta authored and Michal Simek committed Jan 31, 2022
1 parent 6aad636 commit 7e7cd55
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions drivers/gpio/gpio-xilinx.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,28 +280,6 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
return 0;
}

/**
* xgpio_xlate - Translate gpio_spec to the GPIO number and flags
* @gc: Pointer to gpio_chip device structure.
* @gpiospec: gpio specifier as found in the device tree
* @flags: A flags pointer based on binding
*
* Return:
* irq number
*/
static int xgpio_xlate(struct gpio_chip *gc,
const struct of_phandle_args *gpiospec, u32 *flags)
{
if (gc->of_gpio_n_cells == 3 && flags) {
*flags = gpiospec->args[2];
dev_warn(gc->parent, "Please convert #gpio-cells=3 to 2\n");
}
if (gc->of_gpio_n_cells == 2 && flags)
*flags = gpiospec->args[1];

return gpiospec->args[0];
}

/**
* xgpio_save_regs - Set initial values of GPIO pins
* @chip: Pointer to GPIO instance
Expand Down Expand Up @@ -617,7 +595,7 @@ static int xgpio_probe(struct platform_device *pdev)
if (of_property_read_u32(np, "#gpio-cells", &cells))
dev_dbg(&pdev->dev, "Missing gpio-cells property\n");

if (cells != 2 && cells != 3) {
if (cells != 2) {
dev_err(&pdev->dev, "#gpio-cells mismatch\n");
return -EINVAL;
}
Expand Down Expand Up @@ -650,7 +628,6 @@ static int xgpio_probe(struct platform_device *pdev)
chip->gc.base = -1;
chip->gc.ngpio = bitmap_weight(chip->hw_map, 64);
chip->gc.parent = &pdev->dev;
chip->gc.of_xlate = xgpio_xlate;
chip->gc.direction_input = xgpio_dir_in;
chip->gc.direction_output = xgpio_dir_out;
chip->gc.of_gpio_n_cells = cells;
Expand Down

0 comments on commit 7e7cd55

Please sign in to comment.