From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Aring <a.aring@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/4] twl-core: add support for twl6030
Date: Sat, 17 Dec 2011 15:19:04 +0100 [thread overview]
Message-ID: <20111217141904.GX27267@pengutronix.de> (raw)
In-Reply-To: <1323939509-10174-3-git-send-email-a.aring@phytec.de>
On Thu, Dec 15, 2011 at 09:58:27AM +0100, Alexander Aring wrote:
> Add support for twl6030 in twl-core driver.
>
> Signed-off-by: Alexander Aring <a.aring@phytec.de>
> ---
> drivers/mfd/Kconfig | 4 +
> drivers/mfd/Makefile | 1 +
> drivers/mfd/twl6030.c | 77 +++++++++
> include/mfd/twl6030.h | 408 +++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 490 insertions(+), 0 deletions(-)
> create mode 100644 drivers/mfd/twl6030.c
> create mode 100644 include/mfd/twl6030.h
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 72f87c2..2d42a22 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -25,6 +25,10 @@ config I2C_TWL4030
> depends on I2C_TWLCORE
> bool "TWL4030 driver"
>
> +config I2C_TWL6030
> + depends on I2C_TWLCORE
> + bool "TWL6030 driver"
> +
> config DRIVER_SPI_MC13783
> depends on SPI
> bool "MC13783 a.k.a. PMIC driver"
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index b05b2cd..1171335 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -4,4 +4,5 @@ obj-$(CONFIG_I2C_MC9SDZ60) += mc9sdz60.o
> obj-$(CONFIG_I2C_LP3972) += lp3972.o
> obj-$(CONFIG_I2C_TWLCORE) += twl-core.o
> obj-$(CONFIG_I2C_TWL4030) += twl4030.o
> +obj-$(CONFIG_I2C_TWL6030) += twl6030.o
> obj-$(CONFIG_DRIVER_SPI_MC13783) += mc13783.o
> diff --git a/drivers/mfd/twl6030.c b/drivers/mfd/twl6030.c
> new file mode 100644
> index 0000000..4035106
> --- /dev/null
> +++ b/drivers/mfd/twl6030.c
> @@ -0,0 +1,77 @@
> +/*
> + * Made by Alexander Aring <a.aring@phytec.de>
> + *
> + * This file is released under the GPLv2
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <driver.h>
> +#include <xfuncs.h>
> +#include <errno.h>
> +
> +#include <i2c/i2c.h>
> +#include <mfd/twl6030.h>
> +
> +#define DRIVERNAME "twl6030"
> +
> +#define to_twl6030(a) container_of(a, struct twl6030, cdev)
> +
> +static struct twl6030 *twl_dev;
> +
> +struct twl6030 *twl6030_get(void)
> +{
> + return twl_dev;
> +}
> +EXPORT_SYMBOL(twl6030_get);
> +
> +inline int twl6030_reg_read(struct twl6030 *twl6030,
> + enum twl6030_reg reg, u8 *val)
> +{
> + return twlcore_reg_read(&(twl6030->core), reg, val);
> +}
> +EXPORT_SYMBOL(twl6030_reg_read);
Please move these as static inline functions to the header file (also
for the twl4030). As a side note, 'inline' in global functions is a
no-op, you can skip this. Also, unnecessary braces in &(twl6030->core).
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next parent reply other threads:[~2011-12-17 14:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1323939509-10174-1-git-send-email-a.aring@phytec.de>
[not found] ` <1323939509-10174-3-git-send-email-a.aring@phytec.de>
2011-12-17 14:19 ` Sascha Hauer [this message]
[not found] ` <1323939509-10174-4-git-send-email-a.aring@phytec.de>
2011-12-17 14:32 ` [PATCH 3/4] omap_hsmmc: setup mmc voltage on twl6030 Sascha Hauer
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=20111217141904.GX27267@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.aring@phytec.de \
--cc=barebox@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