[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6a00d247-da34-c499-8d2a-b3f336a3d136@quicinc.com>
Date: Mon, 31 Jan 2022 10:47:00 -0800
From: Anjelique Melendez <quic_amelende@...cinc.com>
To: Stephen Boyd <swboyd@...omium.org>, <dmitry.torokhov@...il.com>
CC: <linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <collinsd@...eaurora.org>,
<bjorn.andersson@...aro.org>, <skakit@...eaurora.org>
Subject: Re: [PATCH v2 3/4] input: misc: pm8941-pwrkey: add software key press
debouncing support
On 1/27/2022 2:44 PM, Stephen Boyd wrote:
> Quoting Anjelique Melendez (2022-01-27 13:00:27)
>> diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c
>> index 7005aede4f81..bcdbe260b684 100644
>> --- a/drivers/input/misc/pm8941-pwrkey.c
>> +++ b/drivers/input/misc/pm8941-pwrkey.c
> [...]
>> +static int pm8941_pwrkey_sw_debounce_init(struct pm8941_pwrkey *pwrkey)
>> +{
>> + unsigned int val, addr, mask;
>> + int error;
>> +
>> + if (pwrkey->data->has_pon_pbs && !pwrkey->pon_pbs_baseaddr) {
>> + dev_err(pwrkey->dev, "PON_PBS address missing, can't read HW debounce time\n");
>> + return 0;
>> + }
>> +
>> + if (pwrkey->pon_pbs_baseaddr)
>> + addr = pwrkey->pon_pbs_baseaddr + PON_DBC_CTL;
>> + else
>> + addr = pwrkey->baseaddr + PON_DBC_CTL;
>> + error = regmap_read(pwrkey->regmap, addr, &val);
>> + if (error)
>> + return error;
>> +
>> + if (pwrkey->subtype >= PON_SUBTYPE_GEN2_PRIMARY)
>> + mask = 0xf;
>> + else
>> + mask = 0x7;
>> +
>> + pwrkey->sw_debounce_time_us = 2 * USEC_PER_SEC /
>> + (1 << (mask - (val & mask)));
> pwrkey->sw_debounce_time_us = 2 * USEC_PER_SEC / (1 << (mask
> - (val & mask)));
>
> Nitpick: Put this one one line?
ACK
>
>> +
>> + dev_dbg(pwrkey->dev, "SW debounce time = %u us\n",
>> + pwrkey->sw_debounce_time_us);
>> +
>> + return 0;
>> +}
>> +
>> static int __maybe_unused pm8941_pwrkey_suspend(struct device *dev)
>> {
>> struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev);
Powered by blists - more mailing lists