lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Nov 2019 11:07:34 +0000
From:   "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To:     "lee.jones@...aro.org" <lee.jones@...aro.org>
CC:     "linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
        "dmurphy@...com" <dmurphy@...com>,
        "linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "mturquette@...libre.com" <mturquette@...libre.com>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "mazziesaccount@...il.com" <mazziesaccount@...il.com>,
        "a.zummo@...ertech.it" <a.zummo@...ertech.it>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "jacek.anaszewski@...il.com" <jacek.anaszewski@...il.com>,
        "bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        "sboyd@...nel.org" <sboyd@...nel.org>,
        "pavel@....cz" <pavel@....cz>,
        "broonie@...nel.org" <broonie@...nel.org>
Subject: Re: [RFC PATCH v3 05/15] mfd: input: bd71828: Add power-key support

Hello Lee,

On Mon, 2019-11-11 at 10:59 +0000, Lee Jones wrote:
> On Fri, 01 Nov 2019, Matti Vaittinen wrote:
> 
> > Use gpio_keys to send power input-event to user-space when power
> > button (short) press is detected.
> > 
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> > ---
> > 
> > Changes from v2 - No changes
> > 
> >  drivers/mfd/rohm-bd71828.c | 28 ++++++++++++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> > 
> > diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-
> > bd71828.c
> > index b7de79e1fcdb..f77ba1ec3e99 100644
> > --- a/drivers/mfd/rohm-bd71828.c
> > +++ b/drivers/mfd/rohm-bd71828.c
> > @@ -4,7 +4,9 @@
> >  //
> >  // ROHM BD71828 PMIC driver
> >  
> > +#include <linux/gpio_keys.h>
> >  #include <linux/i2c.h>
> > +#include <linux/input.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/ioport.h>
> >  #include <linux/irq.h>
> > @@ -15,6 +17,18 @@
> >  #include <linux/regmap.h>
> >  #include <linux/types.h>
> >  
> > +static struct gpio_keys_button button = {
> > +	.code = KEY_POWER,
> > +	.gpio = -1,
> > +	.type = EV_KEY,
> > +};
> > +
> > +static struct gpio_keys_platform_data bd71828_powerkey_data = {
> > +	.buttons = &button,
> > +	.nbuttons = 1,
> > +	.name = "bd71828-pwrkey",
> > +};
> > +
> >  static const struct resource rtc_irqs[] = {
> >  	DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd71828-rtc-alm-0"),
> >  	DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC1, "bd71828-rtc-alm-1"),
> > @@ -36,6 +50,10 @@ static struct mfd_cell bd71828_mfd_cells[] = {
> >  		.name = "bd70528-rtc",
> >  		.resources = rtc_irqs,
> >  		.num_resources = ARRAY_SIZE(rtc_irqs),
> > +	}, {
> > +		.name = "gpio-keys",
> > +		.platform_data = &bd71828_powerkey_data,
> > +		.pdata_size = sizeof(bd71828_powerkey_data),
> >  	},
> >  };
> >  
> > @@ -288,9 +306,19 @@ static int bd71828_i2c_probe(struct i2c_client
> > *i2c,
> >  		dev_err(&i2c->dev, "Failed to add IRQ chip\n");
> >  		return ret;
> >  	}
> > +
> 
> This should be fixed in the last patch.
> 
> >  	dev_dbg(&i2c->dev, "Registered %d IRQs for chip\n",
> >  		bd71828_irq_chip.num_irqs);
> >  
> > +	ret = regmap_irq_get_virq(irq_data, BD71828_INT_SHORTPUSH);
> > +
> 
> Remove this empty line.
> 
> > +	if (ret < 0) {
> > +		dev_err(&i2c->dev, "Failed to get the power-key
> > IRQ\n");
> > +		return ret;
> > +	}
> > +
> > +	button.irq = ret;
> > +
> 
> Once fixed, please apply my:
> 
> For my own reference:
>   Acked-for-MFD-by: Lee Jones <lee.jones@...aro.org>
> 

Thanks for checking this :) I'll apply fixes in patch v4.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ