Skip to content

Commit 98df162

Browse files
Bartosz Golaszewskidianders
authored andcommitted
drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6526b02 commit 98df162

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,24 +1672,20 @@ static int ti_sn_bridge_gpio_get(struct gpio_chip *chip, unsigned int offset)
16721672
return !!(val & BIT(SN_GPIO_INPUT_SHIFT + offset));
16731673
}
16741674

1675-
static void ti_sn_bridge_gpio_set(struct gpio_chip *chip, unsigned int offset,
1676-
int val)
1675+
static int ti_sn_bridge_gpio_set(struct gpio_chip *chip, unsigned int offset,
1676+
int val)
16771677
{
16781678
struct ti_sn65dsi86 *pdata = gpiochip_get_data(chip);
1679-
int ret;
16801679

16811680
if (!test_bit(offset, pdata->gchip_output)) {
16821681
dev_err(pdata->dev, "Ignoring GPIO set while input\n");
1683-
return;
1682+
return -EPERM;
16841683
}
16851684

16861685
val &= 1;
1687-
ret = regmap_update_bits(pdata->regmap, SN_GPIO_IO_REG,
1688-
BIT(SN_GPIO_OUTPUT_SHIFT + offset),
1689-
val << (SN_GPIO_OUTPUT_SHIFT + offset));
1690-
if (ret)
1691-
dev_warn(pdata->dev,
1692-
"Failed to set bridge GPIO %u: %d\n", offset, ret);
1686+
return regmap_update_bits(pdata->regmap, SN_GPIO_IO_REG,
1687+
BIT(SN_GPIO_OUTPUT_SHIFT + offset),
1688+
val << (SN_GPIO_OUTPUT_SHIFT + offset));
16931689
}
16941690

16951691
static int ti_sn_bridge_gpio_direction_input(struct gpio_chip *chip,
@@ -1793,7 +1789,7 @@ static int ti_sn_gpio_probe(struct auxiliary_device *adev,
17931789
pdata->gchip.direction_input = ti_sn_bridge_gpio_direction_input;
17941790
pdata->gchip.direction_output = ti_sn_bridge_gpio_direction_output;
17951791
pdata->gchip.get = ti_sn_bridge_gpio_get;
1796-
pdata->gchip.set = ti_sn_bridge_gpio_set;
1792+
pdata->gchip.set_rv = ti_sn_bridge_gpio_set;
17971793
pdata->gchip.can_sleep = true;
17981794
pdata->gchip.names = ti_sn_bridge_gpio_names;
17991795
pdata->gchip.ngpio = SN_NUM_GPIOS;

0 commit comments

Comments
 (0)