From: Randy Dunlap <rdunlap@infradead.org>
To: Anthony Olech <anthony.olech.opensource@diasemi.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Ashish Jangam <ashish.jangam@kpitcummins.com>,
Eric Andersson <eric.andersson@unixphere.com>,
Andrew Jones <drjones@redhat.com>,
linux-input@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
David Dajun Chen <david.chen@diasemi.com>
Subject: Re: [NEW DRIVER V4 3/7] DA9058 ONKEY driver
Date: Fri, 12 Apr 2013 13:01:30 -0700 [thread overview]
Message-ID: <5168681A.20405@infradead.org> (raw)
In-Reply-To: <201304121318.r3CDILZS013210@latitude>
On 04/12/13 06:05, Anthony Olech wrote:
> This is the ONKEY component driver of the Dialog DA9058 PMIC.
> This driver is just one component of the whole DA9058 PMIC driver.
> It depends on the CORE component driver of the DA9058 MFD.
>
> Signed-off-by: Anthony Olech <anthony.olech.opensource@diasemi.com>
> Signed-off-by: David Dajun Chen <david.chen@diasemi.com>
> ---
> drivers/input/misc/Kconfig | 10 +++
> drivers/input/misc/Makefile | 1 +
> drivers/input/misc/da9058_onkey.c | 177 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 188 insertions(+)
> create mode 100644 drivers/input/misc/da9058_onkey.c
>
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 259ef31..bd07b38 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -93,6 +93,16 @@ config INPUT_BMA150
> To compile this driver as a module, choose M here: the
> module will be called bma150.
>
> +config INPUT_DA9058_ONKEY
> + tristate "DA9058 ONKEY support"
> + depends on MFD_DA9058
> + help
> + Support the ONKEY of DA9058 PMICs as an input device
> + reporting power button status.
What possible values can a power button status have?
Must be more than my KISS guess:
this software is running => ON
software not running => OFF
eh?
> +
> + To compile this driver as a module, choose M here: the module
> + will be called da9058_onkey.
> +
> config INPUT_PCSPKR
> tristate "PC Speaker support"
> depends on PCSPKR_PLATFORM
> diff --git a/drivers/input/misc/da9058_onkey.c b/drivers/input/misc/da9058_onkey.c
> new file mode 100644
> index 0000000..969ad70
> --- /dev/null
> +++ b/drivers/input/misc/da9058_onkey.c
> @@ -0,0 +1,177 @@
> +/*
> + * Copyright (C) 2012 Dialog Semiconductor Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + */
> +
> +
> +static int da9058_onkey_probe(struct platform_device *pdev)
> +{
> + struct da9058 *da9058 = dev_get_drvdata(pdev->dev.parent);
> + const struct mfd_cell *cell = mfd_get_cell(pdev);
> + struct da9058_onkey_pdata *onkey_pdata;
> + struct da9058_onkey *onkey;
> + int ret;
> +
> + if (cell == NULL) {
> + ret = -ENODEV;
> + goto exit;
> + }
> +
> + onkey_pdata = cell->platform_data;
> +
> + if (onkey_pdata == NULL) {
> + ret = -EINVAL;
> + goto exit;
> + }
> +
> + dev_info(&pdev->dev, "Starting ONKEY\n");
> +
> + onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9058_onkey),
> + GFP_KERNEL);
> + if (!onkey) {
> + ret = -ENOMEM;
> + goto exit;
> + }
> +
> + platform_set_drvdata(pdev, onkey);
> +
> + onkey->da9058 = da9058;
> + onkey->pdev = pdev;
> +
> + onkey->irq = platform_get_irq(pdev, 0);
> + if (onkey->irq < 0) {
> + dev_err(&pdev->dev, "can not get ONKEY IRQ error=%d\n",
cannot
> + onkey->irq);
--
~Randy
next prev parent reply other threads:[~2013-04-12 20:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-12 13:05 [NEW DRIVER V4 3/7] DA9058 ONKEY driver Anthony Olech
2013-04-12 20:01 ` Randy Dunlap [this message]
2013-04-16 10:33 ` Opensource [Anthony Olech]
2013-04-16 15:15 ` Randy Dunlap
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=5168681A.20405@infradead.org \
--to=rdunlap@infradead.org \
--cc=anthony.olech.opensource@diasemi.com \
--cc=ashish.jangam@kpitcummins.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=david.chen@diasemi.com \
--cc=dmitry.torokhov@gmail.com \
--cc=drjones@redhat.com \
--cc=eric.andersson@unixphere.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).