From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 2/7] MFD: twl6040: Convert to i2c driver, and separate it from twl core
Date: Thu, 2 Feb 2012 12:48:29 +0000 [thread overview]
Message-ID: <20120202124828.GI7428@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1328185019-29575-3-git-send-email-peter.ujfalusi@ti.com>
On Thu, Feb 02, 2012 at 02:16:54PM +0200, Peter Ujfalusi wrote:
> +static int twl6040_i2c_read(struct i2c_client *i2c, u8 *value, u8 reg)
> +{
> + struct i2c_msg msg[2];
> + int ret;
May as well convert to regmap while you're at it, saves some code and
will get you access to the regmap features - you have to make updates in
all the relevant places anyway. We should be pushing to remove use of
the ASoC level code for register cache and whatnot to cut down on code
duplication (especially for MFDs where it has a few issues interacting
with the MFD) and this seems like a good opportunity.
The calling convention here seems a bit weird too, you've got value then
register but normally we have register then value for I2C/SPI devices.
Except when we don't :(
> -module_platform_driver(twl6040_driver);
> +static int __devinit twl6040_init(void)
> +{
> + return i2c_add_driver(&twl6040_driver);
> +}
> +module_init(twl6040_init);
> +
> +static void __devexit twl6040_exit(void)
> +{
> + i2c_del_driver(&twl6040_driver);
> +}
> +
> +module_exit(twl6040_exit);
There's module_i2c_driver() in mainline as of the last merge window.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120202/1319fb4b/attachment-0001.sig>
next prev parent reply other threads:[~2012-02-02 12:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 12:16 [RFC 0/7] MFD: twl6040: Conversion to i2c driver Peter Ujfalusi
2012-02-02 12:16 ` [RFC 1/7] MFD: twl-core: Detach twl6040 from the pmic mfd driver Peter Ujfalusi
[not found] ` <1328185019-29575-5-git-send-email-peter.ujfalusi@ti.com>
2012-02-02 12:38 ` [RFC 4/7] OMAP: 4430sdp: Correct fixed regulator device ID Mark Brown
[not found] ` <1328185019-29575-6-git-send-email-peter.ujfalusi@ti.com>
2012-02-02 12:40 ` [RFC 5/7] OMAP: sdp4430: Add fixed regulator for twl6040 needs Mark Brown
2012-02-02 13:03 ` Peter Ujfalusi
[not found] ` <1328185019-29575-7-git-send-email-peter.ujfalusi@ti.com>
2012-02-02 12:41 ` [RFC 6/7] OMAP: omap4panda: " Mark Brown
[not found] ` <1328185019-29575-4-git-send-email-peter.ujfalusi@ti.com>
2012-02-02 12:42 ` [RFC 3/7] ASoC: twl6040: Remove dependency on twl4030 from Kconfig Mark Brown
[not found] ` <1328185019-29575-3-git-send-email-peter.ujfalusi@ti.com>
2012-02-02 12:48 ` Mark Brown [this message]
2012-02-02 13:01 ` [RFC 2/7] MFD: twl6040: Convert to i2c driver, and separate it from twl core Peter Ujfalusi
2012-02-02 13:27 ` Mark Brown
[not found] ` <1328185019-29575-8-git-send-email-peter.ujfalusi@ti.com>
2012-02-02 12:52 ` [RFC 7/7] MFD: TWL6040: Add regulator support for VIO, V2V1 supplies Mark Brown
2012-02-02 13:18 ` Peter Ujfalusi
2012-02-02 13:32 ` Mark Brown
2012-02-02 13:59 ` Peter Ujfalusi
2012-02-02 14:19 ` Mark Brown
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=20120202124828.GI7428@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).