[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffef0fa6-45e4-467b-b264-1df15754d213@gmail.com>
Date: Wed, 3 Sep 2025 08:23:18 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Bartosz Golaszewski <brgl@...ev.pl>,
Marcelo Schmitt <marcelo.schmitt@...log.com>,
Javier Carrasco <javier.carrasco.cruz@...il.com>,
Tobias Sperling <tobias.sperling@...ting.com>,
Antoniu Miclaus <antoniu.miclaus@...log.com>,
Trevor Gamblin <tgamblin@...libre.com>, Esteban Blanc <eblanc@...libre.com>,
Ramona Alexandra Nechita <ramona.nechita@...log.com>,
Thomas Bonnefille <thomas.bonnefille@...tlin.com>,
Hans de Goede <hansg@...nel.org>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org
Subject: Re: [PATCH 2/3] iio: adc: Support ROHM BD79112 ADC/GPIO
Hi deee Ho Linus,
Long time no chat. Thanks for the review!
On 03/09/2025 01:34, Linus Walleij wrote:
> Hi Matti,
>
> On Tue, Sep 2, 2025 at 2:24 PM Matti Vaittinen <mazziesaccount@...il.com> wrote:
>
>> The ROHM BD79112 is an ADC/GPIO with 32 channels. The channel inputs can
>> be used as ADC or GPIO. Using the GPIOs as IRQ sources isn't supported.
>>
>> The ADC is 12-bit, supporting input voltages up to 5.7V, and separate I/O
>> voltage supply. Maximum SPI clock rate is 20 MHz (10 MHz with
>> daisy-chain configuration) and maximum sampling rate is 1MSPS.
>>
>> The IC does also support CRC but it is not implemented in the driver.
>>
>> Signed-off-by: Matti Vaittinen <mazziesaccount@...il.com>
>
>> +static int bd79112_gpio_dir_get(struct gpio_chip *gc, unsigned int offset)
>> +static int bd79112_gpio_get(struct gpio_chip *gc, unsigned int offset)
>> +static int bd79112_gpio_set(struct gpio_chip *gc, unsigned int offset,
>> + int value)
>> +static int bd79112_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
>> + unsigned long *bits)
>> +static int bd79112_gpio_dir_set(struct bd79112_data *data, unsigned int offset,
>> + int dir)
>> +static int bd79112_gpio_input(struct gpio_chip *gc, unsigned int offset)
>> +static int bd79112_gpio_output(struct gpio_chip *gc, unsigned int offset,
>> + int value)
>
> This looks like it could use
>
> select GPIO_REGMAP
>
> #include <linux/gpio/regmap.h>
>
> struct gpio_regmap_config config = {};
>
> etc. Did you check out the GPIO_REGMAP
> helper library?
I did - but that was couple of years ago :) I was very excited about it
back then. I actually tried (tried hard, fingers almost bleeding) to
write a patch to make it cover all of the ROHM PMIC GPIOs which I had to
deal with. I thought it won't get it's full potential due to it's
somewhat inflexible design. (And to tell the truth, I still believe so).
Anyways, fast-forward to this day, I don't see it handling valid_mask. I
think it is a must for this device/driver, where pins can be either
GPIOs or ADC inputs.
Yours,
-- Matti
Powered by blists - more mailing lists