lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MN2PR03MB5168FCB9B9FB4CA7DFE67A41E7659@MN2PR03MB5168.namprd03.prod.outlook.com>
Date:   Wed, 26 Apr 2023 13:39:29 +0000
From:   "Sahin, Okan" <Okan.Sahin@...log.com>
To:     Michael Walle <michael@...le.cc>
CC:     "andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1 2/2] gpio: ds4520: Add ADI DS4520 Regulator Support

>> 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

Hi,

One last question, as ds4520 IC has 9 I/O pins so I need to set registers like 
below
struct gpio_regmap *gpio;
config.reg_dir_out_base = IO_CONTROL0; (get_direction and setting direction)
config.reg_dat_base = IO_STATUS0; (for .get)
config.reg_set_base = IO_STATUS0; (for .set)

As I have both directions, I must set both reg_dat_base and
reg_set_base.

https://elixir.bootlin.com/linux/latest/source/include/linux/gpio/regmap.h#L52

In this case, I am able to use only pull_up register to set output value to high
as default. Is that okay? I am asking again and again to minimize number of 
patch. I want to be sure before sending new patch. Thank you for your contribution.

Regards,
Okan Sahin


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ