Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Felipe Balbi <balbi@ti.com>, Tony Lindgren <tony@atomide.com>,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [RFC PATCH 1/4] retu-mfd: support also Tahvo
Date: Thu, 7 Mar 2013 16:48:34 +0200	[thread overview]
Message-ID: <20130307144834.GD16577@arwen.pp.htv.fi> (raw)
In-Reply-To: <1362667221-30659-2-git-send-email-aaro.koskinen@iki.fi>

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

Hi,

On Thu, Mar 07, 2013 at 04:40:18PM +0200, Aaro Koskinen wrote:
> Tahvo is a multi-function device on Nokia 770, implementing USB
> transceiver and charge/battery control.
> 
> It's so close to Retu that a single driver can support both.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> ---
>  drivers/mfd/Kconfig      |    6 +--
>  drivers/mfd/retu-mfd.c   |   95 +++++++++++++++++++++++++++++++++++++++-------
>  include/linux/mfd/retu.h |    8 +++-
>  3 files changed, 92 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 671f5b1..0c3bdae 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1101,13 +1101,13 @@ config MFD_VIPERBOARD
>  	  The drivers do not support all features the board exposes.
>  
>  config MFD_RETU
> -	tristate "Support for Retu multi-function device"
> +	tristate "Support for Retu and Tahvo multi-function devices"
>  	select MFD_CORE
>  	depends on I2C && GENERIC_HARDIRQS
>  	select REGMAP_IRQ
>  	help
> -	  Retu is a multi-function device found on Nokia Internet Tablets
> -	  (770, N800 and N810).
> +	  Retu and Tahvo are multi-function devices found on Nokia
> +	  Internet Tablets (770, N800 and N810).
>  
>  config MFD_AS3711
>  	bool "Support for AS3711"
> diff --git a/drivers/mfd/retu-mfd.c b/drivers/mfd/retu-mfd.c
> index 3ba0486..fa0204b 100644
> --- a/drivers/mfd/retu-mfd.c
> +++ b/drivers/mfd/retu-mfd.c
> @@ -1,5 +1,5 @@
>  /*
> - * Retu MFD driver
> + * Retu/Tahvo MFD driver
>   *
>   * Copyright (C) 2004, 2005 Nokia Corporation
>   *
> @@ -29,11 +29,15 @@
>  #include <linux/interrupt.h>
>  #include <linux/moduleparam.h>
>  
> +#define RETU_ID			0
> +#define TAHVO_ID		1

do you really need this ? Why didn't you use the i2c address as the
device ID ?

> @@ -173,9 +233,13 @@ static struct regmap_config retu_config = {
>  
>  static int retu_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
>  {
> +	int chip = id->driver_data;
>  	struct retu_dev *rdev;
>  	int ret;
>  
> +	if (chip >= ARRAY_SIZE(retu_data))
> +		return -EINVAL;

you can figure this out without using 'chip'. Just use the i2c address.

-- 
balbi

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

  reply	other threads:[~2013-03-07 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 14:40 [RFC PATCH 0/4] USB: OMAP: Tahvo USB support for 770 Aaro Koskinen
2013-03-07 14:40 ` [RFC PATCH 1/4] retu-mfd: support also Tahvo Aaro Koskinen
2013-03-07 14:48   ` Felipe Balbi [this message]
     [not found]   ` <1362667221-30659-2-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
2013-04-08 16:25     ` Samuel Ortiz
2013-03-07 14:40 ` [RFC PATCH 2/4] ARM: OMAP1: nokia770: enable Tahvo Aaro Koskinen
     [not found] ` <1362667221-30659-1-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
2013-03-07 14:40   ` [RFC PATCH 3/4] USB: OMAP: move omap-otg out from isp1301_omap Aaro Koskinen
     [not found]     ` <1362667221-30659-4-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
2013-03-07 14:51       ` Felipe Balbi
     [not found]         ` <20130307145158.GE16577-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-03-07 17:59           ` Aaro Koskinen
2013-03-07 14:40 ` [RFC PATCH 4/4] USB: OMAP: Tahvo USB transceiver driver Aaro Koskinen
2013-03-07 14:54   ` Felipe Balbi
2013-03-07 16:20   ` 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=20130307144834.GD16577@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=tony@atomide.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