All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: "Philippe Rétornaz" <philippe.retornaz@epfl.ch>
Cc: s.hauer@pengutronix.de, linux-arm-kernel@lists.infradead.org,
	amit.kucheria@canonical.com, dmitry.torokhov@gmail.com,
	sameo@linux.intel.com, linux-input@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com,
	u.kleine-koenig@pengutronix.de
Subject: Re: [PATCH 5/6] mc13783: add power button support
Date: Fri, 22 Jul 2011 09:07:11 +0800	[thread overview]
Message-ID: <4E28CD3F.5010006@cn.fujitsu.com> (raw)
In-Reply-To: <1311271463-4356-6-git-send-email-philippe.retornaz@epfl.ch>

On 07/22/2011 02:04 AM, Philippe Rétornaz wrote:
> This adds support for the power-on buttons of MC13783 PMIC.
> This is done using a misc input device.
>
> Signed-off-by: Philippe Rétornaz<philippe.retornaz@epfl.ch>
> ---
>   drivers/input/misc/Kconfig             |   10 +
>   drivers/input/misc/Makefile            |    1 +
>   drivers/input/misc/mc13783-pwrbutton.c |  288 ++++++++++++++++++++++++++++++++
>   drivers/mfd/mc13xxx-core.c             |    4 +
>   include/linux/mfd/mc13783.h            |    1 +
>   include/linux/mfd/mc13xxx.h            |   17 ++
>   6 files changed, 321 insertions(+), 0 deletions(-)
>   create mode 100644 drivers/input/misc/mc13783-pwrbutton.c
>
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 45dc6aa..4272658 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -100,6 +100,16 @@ config INPUT_MAX8925_ONKEY
>   	  To compile this driver as a module, choose M here: the module
>   	  will be called max8925_onkey.
>

> +struct mc13783_pwrb {
> +	struct input_dev *pwr;
> +	struct mc13xxx *mc13783;
> +#define MC13783_PWRB_B1_POL_INVERT	(1<<  0)
> +#define MC13783_PWRB_B2_POL_INVERT	(1<<  1)
> +#define MC13783_PWRB_B3_POL_INVERT	(1<<  2)
> +	int flags;
> +	unsigned short keymap[3];
It seems like you just use the keymap[0]?


> +static int __devinit mc13783_pwrbutton_probe(struct platform_device *pdev)
> +{
> +	struct mc13xxx_buttons_platform_data *pdata;
> +	struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent);
> +	struct input_dev *pwr;
> +	struct mc13783_pwrb *priv;
> +	int err = 0;
> +	int reg = 0;
> +
> +	pdata = dev_get_platdata(&pdev->dev);
> +	if (pdata == NULL) {
why not !pdata ? be consistent with below?


> +static int __devexit mc13783_pwrbutton_remove(struct platform_device *pdev)
> +{
> +	struct mc13783_pwrb *priv = platform_get_drvdata(pdev);
> +	struct mc13xxx_buttons_platform_data *pdata;
> +	pdata = dev_get_platdata(&pdev->dev);
> +
> +	mc13xxx_lock(priv->mc13783);
> +
> +	if (pdata->b3on_flags&  MC13783_BUTTON_ENABLE)
> +		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD3, priv);
> +	if (pdata->b2on_flags&  MC13783_BUTTON_ENABLE)
> +		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD2, priv);
> +	if (pdata->b1on_flags&  MC13783_BUTTON_ENABLE)
> +		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD1, priv);
> +
> +	mc13xxx_unlock(priv->mc13783);
> +
> +	input_unregister_device(priv->pwr);
> +	kfree(priv);
	platform_set_drvdata(pdev, NULL);
> +
> +	return 0;
> +}
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: gaowanlong@cn.fujitsu.com (Wanlong Gao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] mc13783: add power button support
Date: Fri, 22 Jul 2011 09:07:11 +0800	[thread overview]
Message-ID: <4E28CD3F.5010006@cn.fujitsu.com> (raw)
In-Reply-To: <1311271463-4356-6-git-send-email-philippe.retornaz@epfl.ch>

On 07/22/2011 02:04 AM, Philippe R?tornaz wrote:
> This adds support for the power-on buttons of MC13783 PMIC.
> This is done using a misc input device.
>
> Signed-off-by: Philippe R?tornaz<philippe.retornaz@epfl.ch>
> ---
>   drivers/input/misc/Kconfig             |   10 +
>   drivers/input/misc/Makefile            |    1 +
>   drivers/input/misc/mc13783-pwrbutton.c |  288 ++++++++++++++++++++++++++++++++
>   drivers/mfd/mc13xxx-core.c             |    4 +
>   include/linux/mfd/mc13783.h            |    1 +
>   include/linux/mfd/mc13xxx.h            |   17 ++
>   6 files changed, 321 insertions(+), 0 deletions(-)
>   create mode 100644 drivers/input/misc/mc13783-pwrbutton.c
>
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 45dc6aa..4272658 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -100,6 +100,16 @@ config INPUT_MAX8925_ONKEY
>   	  To compile this driver as a module, choose M here: the module
>   	  will be called max8925_onkey.
>

> +struct mc13783_pwrb {
> +	struct input_dev *pwr;
> +	struct mc13xxx *mc13783;
> +#define MC13783_PWRB_B1_POL_INVERT	(1<<  0)
> +#define MC13783_PWRB_B2_POL_INVERT	(1<<  1)
> +#define MC13783_PWRB_B3_POL_INVERT	(1<<  2)
> +	int flags;
> +	unsigned short keymap[3];
It seems like you just use the keymap[0]?


> +static int __devinit mc13783_pwrbutton_probe(struct platform_device *pdev)
> +{
> +	struct mc13xxx_buttons_platform_data *pdata;
> +	struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent);
> +	struct input_dev *pwr;
> +	struct mc13783_pwrb *priv;
> +	int err = 0;
> +	int reg = 0;
> +
> +	pdata = dev_get_platdata(&pdev->dev);
> +	if (pdata == NULL) {
why not !pdata ? be consistent with below?


> +static int __devexit mc13783_pwrbutton_remove(struct platform_device *pdev)
> +{
> +	struct mc13783_pwrb *priv = platform_get_drvdata(pdev);
> +	struct mc13xxx_buttons_platform_data *pdata;
> +	pdata = dev_get_platdata(&pdev->dev);
> +
> +	mc13xxx_lock(priv->mc13783);
> +
> +	if (pdata->b3on_flags&  MC13783_BUTTON_ENABLE)
> +		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD3, priv);
> +	if (pdata->b2on_flags&  MC13783_BUTTON_ENABLE)
> +		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD2, priv);
> +	if (pdata->b1on_flags&  MC13783_BUTTON_ENABLE)
> +		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD1, priv);
> +
> +	mc13xxx_unlock(priv->mc13783);
> +
> +	input_unregister_device(priv->pwr);
> +	kfree(priv);
	platform_set_drvdata(pdev, NULL);
> +
> +	return 0;
> +}
> +

  parent reply	other threads:[~2011-07-22  1:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 18:04 [PATCH v5 0/6] mc13783: add pwr button support Philippe Rétornaz
2011-07-21 18:04 ` Philippe Rétornaz
2011-07-21 18:04 ` [PATCH 1/6] mc13xxx: Unconditionally register regulator subdevice Philippe Rétornaz
2011-07-21 18:04   ` Philippe Rétornaz
2011-07-21 18:04   ` [PATCH 2/6] mc13xxx: implicitly register led subdevice Philippe Rétornaz
2011-07-21 18:04     ` Philippe Rétornaz
2011-07-21 18:04     ` [PATCH 3/6] mc13xxx: remove obsolete leds and regualtors flags Philippe Rétornaz
2011-07-21 18:04       ` Philippe Rétornaz
2011-07-21 18:04       ` [PATCH 4/6] mc13xxx: remove unused define Philippe Rétornaz
2011-07-21 18:04         ` Philippe Rétornaz
2011-07-21 18:04         ` [PATCH 5/6] mc13783: add power button support Philippe Rétornaz
2011-07-21 18:04           ` Philippe Rétornaz
2011-07-21 18:04           ` [PATCH 6/6] mx31moboard: Add MC13783 " Philippe Rétornaz
2011-07-21 18:04             ` Philippe Rétornaz
2011-07-22  1:07           ` Wanlong Gao [this message]
2011-07-22  1:07             ` [PATCH 5/6] mc13783: add " Wanlong Gao
2011-07-22 13:21             ` Philippe Rétornaz
2011-07-22 13:21               ` Philippe Rétornaz
2011-07-22  5:00           ` Dmitry Torokhov
2011-07-22  5:00             ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2011-07-22 14:17 [PATCH v6 0/6] mc13783: add pwr " Philippe Rétornaz
2011-07-22 14:17 ` [PATCH 1/6] mc13xxx: Unconditionally register regulator subdevice Philippe Rétornaz
2011-07-22 14:17   ` [PATCH 2/6] mc13xxx: implicitly register led subdevice Philippe Rétornaz
2011-07-22 14:17     ` [PATCH 3/6] mc13xxx: remove obsolete leds and regulators flags Philippe Rétornaz
2011-07-22 14:17       ` [PATCH 4/6] mc13xxx: remove unused define Philippe Rétornaz
2011-07-22 14:17         ` [PATCH 5/6] mc13783: add power button support Philippe Rétornaz
2011-07-22 14:17           ` Philippe Rétornaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E28CD3F.5010006@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=amit.kucheria@canonical.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=philippe.retornaz@epfl.ch \
    --cc=s.hauer@pengutronix.de \
    --cc=sameo@linux.intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.