[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250408-gpiochip-set-rv-sound-v1-11-dd54b6ca1ef9@linaro.org>
Date: Tue, 08 Apr 2025 09:38:29 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Peter Ujfalusi <peter.ujfalusi@...il.com>,
Oder Chiou <oder_chiou@...ltek.com>, Shenghao Ding <shenghao-ding@...com>,
Kevin Lu <kevin-lu@...com>, Baojun Xu <baojun.xu@...com>,
Herve Codina <herve.codina@...tlin.com>,
David Rhodes <david.rhodes@...rus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>
Cc: linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, patches@...nsource.cirrus.com,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: [PATCH 11/12] ASoC: codecs: zl38060: use new GPIO line value
setter callbacks
From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
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 <bartosz.golaszewski@...aro.org>
---
sound/soc/codecs/zl38060.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/zl38060.c b/sound/soc/codecs/zl38060.c
index 28c92d90299e..180d45a349ac 100644
--- a/sound/soc/codecs/zl38060.c
+++ b/sound/soc/codecs/zl38060.c
@@ -387,12 +387,12 @@ static const struct snd_soc_component_driver zl38_component_dev = {
.endianness = 1,
};
-static void chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
+static int chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
{
struct regmap *regmap = gpiochip_get_data(c);
unsigned int mask = BIT(offset);
- regmap_update_bits(regmap, REG_GPIO_DAT, mask, val ? mask : 0);
+ return regmap_update_bits(regmap, REG_GPIO_DAT, mask, val ? mask : 0);
}
static int chip_gpio_get(struct gpio_chip *c, unsigned int offset)
@@ -422,8 +422,12 @@ chip_direction_output(struct gpio_chip *c, unsigned int offset, int val)
{
struct regmap *regmap = gpiochip_get_data(c);
unsigned int mask = BIT(offset);
+ int ret;
+
+ ret = chip_gpio_set(c, offset, val);
+ if (ret)
+ return ret;
- chip_gpio_set(c, offset, val);
return regmap_update_bits(regmap, REG_GPIO_DIR, mask, mask);
}
@@ -436,7 +440,7 @@ static const struct gpio_chip template_chip = {
.direction_input = chip_direction_input,
.direction_output = chip_direction_output,
.get = chip_gpio_get,
- .set = chip_gpio_set,
+ .set_rv = chip_gpio_set,
.can_sleep = true,
};
--
2.45.2
Powered by blists - more mailing lists