public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: <linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sameo@linux.intel.com>
Subject: Re: [PATCH v2 2/4] mfd: introduce retu-mfd driver
Date: Wed, 31 Oct 2012 20:37:30 +0200	[thread overview]
Message-ID: <20121031183730.GD28100@arwen.pp.htv.fi> (raw)
In-Reply-To: <1351706626-32186-3-git-send-email-aaro.koskinen@iki.fi>

[-- Attachment #1: Type: text/plain, Size: 4048 bytes --]

On Wed, Oct 31, 2012 at 08:03:44PM +0200, Aaro Koskinen wrote:
> Retu is a multi-function device found on Nokia Internet Tablets
> implementing at least watchdog, RTC, headset detection and power button
> functionality.
> 
> This patch implements minimum functionality providing register access,
> IRQ handling and power off functions.
> 
> Cc: sameo@linux.intel.com
> Acked-by: Felipe Balbi <balbi@ti.com>
> Acked-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  drivers/mfd/Kconfig      |    9 ++
>  drivers/mfd/Makefile     |    1 +
>  drivers/mfd/retu-mfd.c   |  264 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/retu.h |   22 ++++
>  4 files changed, 296 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/retu-mfd.c
>  create mode 100644 include/linux/mfd/retu.h
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index acab3ef..7528c5e 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1044,6 +1044,15 @@ config MFD_PALMAS
>  	  If you say yes here you get support for the Palmas
>  	  series of PMIC chips from Texas Instruments.
>  
> +config MFD_RETU
> +	tristate "Support for Retu multi-function device"
> +	select MFD_CORE
> +	depends on I2C
> +	select REGMAP_IRQ
> +	help
> +	  Retu is a multi-function device found on Nokia Internet Tablets
> +	  (770, N800 and N810).
> +
>  endmenu
>  endif
>  
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index d8ccb63..ad7879f 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -138,3 +138,4 @@ obj-$(CONFIG_MFD_RC5T583)	+= rc5t583.o rc5t583-irq.o
>  obj-$(CONFIG_MFD_SEC_CORE)	+= sec-core.o sec-irq.o
>  obj-$(CONFIG_MFD_SYSCON)	+= syscon.o
>  obj-$(CONFIG_MFD_LM3533)	+= lm3533-core.o lm3533-ctrlbank.o
> +obj-$(CONFIG_MFD_RETU)		+= retu-mfd.o
> diff --git a/drivers/mfd/retu-mfd.c b/drivers/mfd/retu-mfd.c
> new file mode 100644
> index 0000000..8f81566
> --- /dev/null
> +++ b/drivers/mfd/retu-mfd.c
> @@ -0,0 +1,264 @@
> +/*
> + * Retu MFD driver
> + *
> + * Copyright (C) 2004, 2005 Nokia Corporation
> + *
> + * Based on code written by Juha Yrjölä, David Weinehall and Mikko Ylinen.
> + * Rewritten by Aaro Koskinen.
> + *
> + * This file is subject to the terms and conditions of the GNU General
> + * Public License. See the file "COPYING" in the main directory of this
> + * archive for more details.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/irq.h>
> +#include <linux/init.h>
> +#include <linux/slab.h>
> +#include <linux/mutex.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +#include <linux/mfd/core.h>
> +#include <linux/mfd/retu.h>
> +#include <linux/interrupt.h>
> +#include <linux/moduleparam.h>
> +
> +/* Registers */
> +#define RETU_REG_ASICR		0x00		/* ASIC ID and revision */
> +#define RETU_REG_ASICR_VILMA	(1 << 7)	/* Bit indicating Vilma */
> +#define RETU_REG_IDR		0x01		/* Interrupt ID */
> +#define RETU_REG_IMR		0x02		/* Interrupt mask */
> +
> +/* Interrupt sources */
> +#define RETU_INT_PWR		0		/* Power button */
> +
> +struct retu_dev {
> +	struct regmap			*regmap;
> +	struct device			*dev;
> +	struct mutex			mutex;
> +	struct regmap_irq_chip_data	*irq_data;
> +};
> +
> +static struct resource retu_pwrbutton_res[] = {
> +	{
> +		.name	= "retu-pwrbutton",
> +		.start	= RETU_INT_PWR,
> +		.end	= RETU_INT_PWR,
> +		.flags	= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct mfd_cell retu_devs[] = {
> +	{
> +		.name		= "retu-wdt"
> +	},
> +	{
> +		.name		= "retu-pwrbutton",
> +		.resources	= &retu_pwrbutton_res[0],

.resources = retu_powerbutton_res, ??

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-10-31 18:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 18:03 [PATCH v2 0/4] cbus/retu drivers Aaro Koskinen
2012-10-31 18:03 ` [PATCH v2 1/4] i2c: introduce i2c-cbus driver Aaro Koskinen
2012-10-31 18:34   ` Felipe Balbi
2012-11-06 18:11   ` Tony Lindgren
2012-10-31 18:03 ` [PATCH v2 2/4] mfd: introduce retu-mfd driver Aaro Koskinen
2012-10-31 18:37   ` Felipe Balbi [this message]
2012-10-31 18:03 ` [PATCH v2 3/4] watchdog: introduce retu_wdt driver Aaro Koskinen
2012-11-06 18:13   ` Tony Lindgren
2012-10-31 18:03 ` [PATCH v2 4/4] input: misc: introduce retu-pwrbutton Aaro Koskinen
2012-10-31 19:13   ` Dmitry Torokhov
2012-11-06 18:14   ` Tony Lindgren

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=20121031183730.GD28100@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@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