[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZlYyJpLeDLD_T5V6@surfacebook.localdomain>
Date: Tue, 28 May 2024 22:36:06 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-pwm@...r.kernel.org,
Alexandru Ardelean <alexandru.ardelean@...log.com>,
Bartosz Golaszewski <brgl@...ev.pl>,
Conor Dooley <conor+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Lee Jones <lee@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh@...nel.org>,
Uwe Kleine-König <ukleinek@...nel.org>,
Haibo Chen <haibo.chen@....com>
Subject: Re: [PATCH v2 3/4] gpio: adp5585: Add Analog Devices ADP5585 support
Tue, May 28, 2024 at 10:03:13PM +0300, Laurent Pinchart kirjoitti:
> From: Haibo Chen <haibo.chen@....com>
>
> The ADP5585 is a 10/11 input/output port expander with a built in keypad
> matrix decoder, programmable logic, reset generator, and PWM generator.
> This driver supports the GPIO function using the platform device
> registered by the core MFD driver.
>
> The driver is derived from an initial implementation from NXP, available
> in commit 451f61b46b76 ("MLK-25917-2 gpio: adp5585-gpio: add
> adp5585-gpio support") in their BSP kernel tree. It has been extensively
> rewritten.
Why is this not using gpio-regmap?
..
> +#include <linux/device.h>
> +#include <linux/gpio/driver.h>
> +#include <linux/mfd/adp5585.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
+ types.h
..
> + bit = off * 2 + (off > 5 ? 4 : 0);
Right, but can you use >= 6 here which immediately follows to the next
question, i.e. why not use bank in this conditional?
..
> + struct adp5585_dev *adp5585 = dev_get_drvdata(pdev->dev.parent);
(see below)
> + struct adp5585_gpio_dev *adp5585_gpio;
> + struct device *dev = &pdev->dev;
struct adp5585_dev *adp5585 = dev_get_drvdata(dev->parent);
> + struct gpio_chip *gc;
> + int ret;
..
> + platform_set_drvdata(pdev, adp5585_gpio);
Any use of driver data?
..
> + device_set_of_node_from_dev(dev, dev->parent);
Why not device_set_node()?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists