lkml.org 
[lkml]   [2022]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v20 2/3] Input: mt6779-keypad - Add MediaTek keypad driver
On Thu, Jan 27, 2022 at 12:15:25PM +0100, Mattijs Korpershoek wrote:
> From: "fengping.yu" <fengping.yu@mediatek.com>
>
> This patch adds matrix keypad support for Mediatek SoCs.

Some comments which may be addressed now or in the follow-up patch(es).
Up to you.

...

> +static const struct regmap_config mt6779_keypad_regmap_cfg = {
> + .reg_bits = 32,
> + .val_bits = 32,

> + .reg_stride = sizeof(u32),

I'm wondering if we need this when we have reg_bits = 32 already.

> + .max_register = 36,
> +};

...

> + regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE,
> + (debounce * 32) & MTK_KPD_DEBOUNCE_MASK);

I'm wondering if << 5 is more specific to show that the value
is based on 2^5 units.

...

> + error = devm_add_action_or_reset(&pdev->dev, mt6779_keypad_clk_disable, keypad->clk);

You have this long line...

> + error = devm_request_threaded_irq(&pdev->dev, irq,
> + NULL, mt6779_keypad_irq_handler,
> + IRQF_ONESHOT,
> + MTK_KPD_NAME, keypad);

...at the same time you may reduce LOCs here...

> + if (error) {
> + dev_err(&pdev->dev, "Failed to request IRQ#%d:%d\n",
> + irq, error);

...and here.

> + return error;
> + }

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-01-27 16:22    [W:0.062 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site