Re: [PATCH v4 2/4] mfd: adp5585: Add Analog Devices ADP5585 core support

From: Andy Shevchenko
Date: Mon Jun 10 2024 - 11:12:16 EST


Sat, Jun 08, 2024 at 05:16:31PM +0300, Laurent Pinchart kirjoitti:
> From: Haibo Chen <haibo.chen@xxxxxxx>
>
> 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 chip by modelling it as an MFD device, with two
> child devices for the GPIO and PWM functions.
>
> The driver is derived from an initial implementation from NXP, available
> in commit 8059835bee19 ("MLK-25917-1 mfd: adp5585: add ADI adp5585 core
> support") in their BSP kernel tree. It has been extensively rewritten.

...

> +#include <linux/array_size.h>
> +#include <linux/device.h>

+ err.h

> +#include <linux/i2c.h>
> +#include <linux/mfd/adp5585.h>
> +#include <linux/mfd/core.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +#include <linux/types.h>

...

> +static const struct mfd_cell adp5585_devs[] = {
> + { .name = "adp5585-gpio", },
> + { .name = "adp5585-pwm", },

Inner commas are not needed.

> +};

...

> +#define ADP5585_Rx_PULL_CFG_PU_300K 0
> +#define ADP5585_Rx_PULL_CFG_PD_300K 1
> +#define ADP5585_Rx_PULL_CFG_PU_100K 2
> +#define ADP5585_Rx_PULL_CFG_DISABLE 3
> +#define ADP5585_Rx_PULL_CFG_MASK 3

Still supplying MASK is strange, why not supplying DISABLE?

...

> +#define ADP5585_OSC_EN BIT(7)
> +#define ADP5585_OSC_FREQ_50KHZ (0U << 5)
> +#define ADP5585_OSC_FREQ_100KHZ (1U << 5)
> +#define ADP5585_OSC_FREQ_200KHZ (2U << 5)
> +#define ADP5585_OSC_FREQ_500KHZ (3U << 5)
> +#define ADP5585_OSC_FREQ_MASK (3U << 5)

GENMASK() ? And possible the similar question as per above.

--
With Best Regards,
Andy Shevchenko