mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Re: [PATCH 2/4] twl-core: add support for twl6030
       [not found] ` <1323939509-10174-3-git-send-email-a.aring@phytec.de>
@ 2011-12-17 14:19   ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2011-12-17 14:19 UTC (permalink / raw)
  To: Alexander Aring; +Cc: barebox

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/4] omap_hsmmc: setup mmc voltage on twl6030
       [not found] ` <1323939509-10174-4-git-send-email-a.aring@phytec.de>
@ 2011-12-17 14:32   ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2011-12-17 14:32 UTC (permalink / raw)
  To: Alexander Aring; +Cc: barebox

On Thu, Dec 15, 2011 at 09:58:28AM +0100, Alexander Aring wrote:
> Support the setup of the mmc voltage, when booting OMAP4 with twl6030
> from nand.
> 
>  
> +config MCI_OMAP_TWL6030_FIX
> +	bool "OMAP HSMMC TWL6030 FIX"
> +	depends on I2C_TWLCORE && MCI_OMAP_HSMMC && ARCH_OMAP4
> +	help
> +	  Enable TWL6030 support for mci device. OMAP4 Bootloader doesn't setup
> +	  mmc voltage. So to setup mmc voltage you need to enable this.

We do not need a config switch for this.

Please instead of putting this into driver code just put all code in
this patch into some function in arch/arm/mach-omap/omap4_twl6030_mmc.c
which you then call from your board code. This may not be the cleanest
way to do it but moving it into the mmc driver is not a good solution
either.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-17 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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   ` [PATCH 2/4] twl-core: add support for twl6030 Sascha Hauer
     [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox