From: Jonathan Cameron <Jonathan.Cameron@gmail.com>
To: Mike Rapoport <mike@compulab.co.il>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
LKML <linux-kernel@vger.kernel.org>,
Mark Brown <broonie@sirena.org.uk>,
Samuel Ortiz <sameo@openedhand.com>,
eric miao <eric.y.miao@gmail.com>,
felipe.balbi@nokia.com, Liam Girdwood <lrg@kernel.org>
Subject: Re: [PATCH 2.6.29-rc1-git4] mfd: da9030 usb charge pump support within mfd driver.
Date: Thu, 15 Jan 2009 11:11:30 +0000 [thread overview]
Message-ID: <496F19E2.8070306@gmail.com> (raw)
In-Reply-To: <496ED9EF.2050507@compulab.co.il>
Mike Rapoport wrote:
> Jonathan,
> Below are my two cents :)
>
Thanks,
> Jonathan Cameron wrote:
>
>> From: Jonathan Cameron <jic23@cam.ac.uk>
>>
>> Add support for changing the mode of the da9030 usb charge pump
>>
>> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
>>
>> ---
>>
>> Minor changes from previous version to reflect changes in the
>> driver being patched. Addtional cc's as per Mark's suggestion.
>>
>> This version simply adds the functionality to the da903x mfd driver
>> core. If anyone can suggest a way round simply maintaining a
>> global pointer to the device it would be good.
>>
>
> I don't think the global pointer here is real problem. It should be *really*
> weird design with two da903x.
>
>
>> To be able to call this from a board config file the driver must be
>> built in rather than a module but enforcing that is down to the
>> board Kconfig entry.
>>
>
> Most probably the board with da9030 will anyway have it built-in...
>
>
>> diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c
>> index 99f8dcf..70ec3b0 100644
>> --- a/drivers/mfd/da903x.c
>> +++ b/drivers/mfd/da903x.c
>> @@ -30,6 +30,7 @@
>> #define DA9030_SYS_CTRL_A 0x08
>> #define DA9030_SYS_CTRL_B 0x09
>> #define DA9030_FAULT_LOG 0x0a
>> +#define DA9030_USBPUMP_REG 0x19
>>
>> #define DA9034_CHIP_ID 0x00
>> #define DA9034_EVENT_A 0x01
>> @@ -484,6 +485,32 @@ failed:
>> return ret;
>> }
>>
>> +/* Single device assumption */
>> +struct device *da9030_mfd_dev;
>> +
>> +int da9030_set_usb_charge_pump_mode(int mode)
>> +{
>> + uint8_t val = 0;
>> +
>> + if (da9030_mfd_dev == NULL)
>> + return -EINVAL;
>> +
>> + switch (mode) {
>> + case DA9030_USBPUMP_AUTO:
>> + val = 0;
>> + break;
>> + case DA9030_USBPUMP_CHARGE_PUMP:
>> + val = 0x40;
>> + break;
>> + case DA9030_USBPUMP_CURRENT_SOURCE:
>> + val = 0x80;
>> + break;
>> + }
>> +
>> + return da903x_write(da9030_mfd_dev, DA9030_USBPUMP_REG, val);
>> +}
>> +EXPORT_SYMBOL_GPL(da9030_set_usb_charge_pump_mode);
>> +
>>
>
> Maybe we want to have 'da9030_set_usb_charge_pump_mode' as well?
>
(get?)
Possibly though not sure under what circumstances it would be needed
other than debugging?
next prev parent reply other threads:[~2009-01-15 11:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-14 18:16 [PATCH 2.6.29-rc1-git4] mfd: da9030 usb charge pump support within mfd driver Jonathan Cameron
2009-01-15 1:04 ` Eric Miao
2009-01-15 6:34 ` Mike Rapoport
2009-01-15 7:02 ` Eric Miao
2009-01-15 7:28 ` Mike Rapoport
2009-01-15 8:13 ` Eric Miao
2009-01-15 11:22 ` Jonathan Cameron
2009-01-15 13:02 ` Mark Brown
2009-01-15 13:31 ` Jonathan Cameron
2009-01-15 18:36 ` Mark Brown
2009-01-15 6:38 ` Mike Rapoport
2009-01-15 11:11 ` Jonathan Cameron [this message]
2009-01-15 11:23 ` Mike Rapoport
2009-01-15 11:14 ` Jonathan Cameron
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=496F19E2.8070306@gmail.com \
--to=jonathan.cameron@gmail.com \
--cc=broonie@sirena.org.uk \
--cc=eric.y.miao@gmail.com \
--cc=felipe.balbi@nokia.com \
--cc=jic23@cam.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@kernel.org \
--cc=mike@compulab.co.il \
--cc=sameo@openedhand.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 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.