Re: [PATCH v1 2/2] gpio: ds4520: Add ADI DS4520 Regulator Support

From: Michael Walle
Date: Wed Apr 26 2023 - 07:54:40 EST


Hi,

I think I understand what you are trying to say so far. I did not have too much
experience related to gpio. I will set pull_up register in .set_config
However, I did not understand where its parameters come from.
set_config(struct gpio_chip *chip, unsigned int offset,
unsigned long config)
It might be trivial question, but Where does config come from?

Others have to answer that one as I don't have that much experience either.

At the end, I should rewrite the code using regmap_gpio, right? So if I rewrite
code using regmap_gpio, how can I replace set_config(...)?

You'd have to add a .set_config to gpio_regmap_config and then in

gpio_regmap_register():
gpio->set_config = config->set_config;

I don't think it makes sense to have a default implementation in gpio-regmap,
the variances between "simple" gpio controllers might be too broad.

-michael