2023-08-08 19:56:05

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] input: keyboard: Add sprd-keypad driver

On Tue, Aug 8, 2023, at 09:25, Wenhua Lin wrote:
> Add matrix keypad driver, support matrix keypad function.
>
> Signed-off-by: Wenhua Lin <[email protected]>

Looks fine to me, just one minor thing to remember:

> +static int __maybe_unused sprd_keypad_resume(struct device *dev)
> +{
> + struct sprd_keypad_data *data = dev_get_drvdata(dev);
> + int ret = 0;
> +
> + if (!device_may_wakeup(dev)) {
> + ret = sprd_keypad_enable(data);
> + if (ret)
> + return ret;
> + ret = sprd_keypad_hw_init(data);
> + }
> +
> + return ret;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(sprd_keypad_pm_ops,
> + sprd_keypad_suspend, sprd_keypad_resume);
> +

SIMPLE_DEV_PM_OPS() is deprecated, please use the new
DEFINE_SIMPLE_DEV_PM_OPS() for all new drivers, and
remove the __maybe_unused annotation that is no longer
needed with that.

With that addressed (for the driver in general, I know nothing
about the drivers/input specifics)

Acked-by: Arnd Bergmann <[email protected]>

Arnd


2023-08-10 08:56:47

by wenhua lin

[permalink] [raw]
Subject: Re: [PATCH] input: keyboard: Add sprd-keypad driver

On Tue, Aug 8, 2023 at 4:02 PM Arnd Bergmann <[email protected]> wrote:
>
> On Tue, Aug 8, 2023, at 09:25, Wenhua Lin wrote:
> > Add matrix keypad driver, support matrix keypad function.
> >
> > Signed-off-by: Wenhua Lin <[email protected]>
>
> Looks fine to me, just one minor thing to remember:
>
> > +static int __maybe_unused sprd_keypad_resume(struct device *dev)
> > +{
> > + struct sprd_keypad_data *data = dev_get_drvdata(dev);
> > + int ret = 0;
> > +
> > + if (!device_may_wakeup(dev)) {
> > + ret = sprd_keypad_enable(data);
> > + if (ret)
> > + return ret;
> > + ret = sprd_keypad_hw_init(data);
> > + }
> > +
> > + return ret;
> > +}
> > +
> > +static SIMPLE_DEV_PM_OPS(sprd_keypad_pm_ops,
> > + sprd_keypad_suspend, sprd_keypad_resume);
> > +
>
> SIMPLE_DEV_PM_OPS() is deprecated, please use the new
> DEFINE_SIMPLE_DEV_PM_OPS() for all new drivers, and
> remove the __maybe_unused annotation that is no longer
> needed with that.
>
> With that addressed (for the driver in general, I know nothing
> about the drivers/input specifics)
>
> Acked-by: Arnd Bergmann <[email protected]>
>
> Arnd

Hi Arnd:
We will fix the problem of SIMPLE_DEV_PM_OPS in patch v2.

Thanks
Wenhua.Lin