patch serial for mc13783 and mc13892
Subsystems (5)
Given the long review process, reviewers and maintainers may be confused about the order of these patches. I resend these patches based on git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git, for maintainer's convenience.
PATCH 1/3 Change the register name definitions for mc13783
From: Yong Shen <[email protected]>
To make mc13783 and mc13892 share code, the register names should be changed to fit the new macro definitions in the comming patch.
--- arch/arm/mach-imx/mach-pcm038.c | 4 +- arch/arm/mach-mx3/mach-mx31_3ds.c | 4 +- arch/arm/mach-mx3/mach-mx31moboard.c | 4 +- drivers/regulator/mc13783-regulator.c | 30 +++++++------- include/linux/mfd/mc13783.h | 67 +++++++++++++++++---------------- 5 files changed, 55 insertions(+), 54 deletions(-)
arch/arm/mach-imx/mach-pcm038.c +2 -2
@@ -258,10 +258,10 @@ static struct regulator_init_data cam_data = {static struct mc13783_regulator_init_data pcm038_regulators[] = { { - .id =MC13783_REGU_VCAM , + .id =MC13783_REG_VCAM , .init_data = &cam_data, }, { - .id =MC13783_REGU_VMMC1 , + .id =MC13783_REG_VMMC1 , .init_data = &sdhc1_data, }, };
arch/arm/mach-mx3/mach-mx31_3ds.c +2 -2
@@ -117,10 +117,10 @@ static struct regulator_init_data pwgtx_init = {static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { { - .id =MC13783_REGU_PWGT1SPI ,/* Power Gate for ARM core. */ + .id =MC13783_REG_PWGT1SPI ,/* Power Gate for ARM core. */ .init_data = &pwgtx_init, }, { - .id =MC13783_REGU_PWGT2SPI ,/* Power Gate for L2 Cache. */ + .id =MC13783_REG_PWGT2SPI ,/* Power Gate for L2 Cache. */ .init_data = &pwgtx_init, }, };
arch/arm/mach-mx3/mach-mx31moboard.c +2 -2
@@ -218,11 +218,11 @@ static struct regulator_init_data cam_vreg_data = {static struct mc13783_regulator_init_data moboard_regulators[] = { { - .id =MC13783_REGU_VMMC1 , + .id =MC13783_REG_VMMC1 , .init_data = &sdhc_vreg_data, }, { - .id =MC13783_REGU_VCAM , + .id =MC13783_REG_VCAM , .init_data = &cam_vreg_data, }, };
drivers/regulator/mc13783-regulator.c +15 -15
@@ -228,15 +228,15 @@ static struct regulator_ops mc13783_gpo_regulator_ops; }#define MC13783_DEFINE_SW (_name, _reg, _vsel_reg, _voltages) \ - MC13783_DEFINE(SW, _name, _reg, _vsel_reg, _voltages) + MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages)#define MC13783_DEFINE_REGU (_name, _reg, _vsel_reg, _voltages) \ - MC13783_DEFINE(REGU, _name, _reg, _vsel_reg, _voltages) + MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages)static struct mc13783_regulator mc13783_regulators[] = {MC13783_DEFINE_SW (SW3 ,SWITCHERS5 ,SWITCHERS5 , mc13783_sw3_val), -MC13783_FIXED_DEFINE (REGU ,VAUDIO ,REGULATORMODE0 , mc13783_vaudio_val), -MC13783_FIXED_DEFINE (REGU ,VIOHI ,REGULATORMODE0 , mc13783_viohi_val), +MC13783_FIXED_DEFINE (REG ,VAUDIO ,REGULATORMODE0 , mc13783_vaudio_val), +MC13783_FIXED_DEFINE (REG ,VIOHI ,REGULATORMODE0 , mc13783_viohi_val),MC13783_DEFINE_REGU (VIOLO ,REGULATORMODE0 ,REGULATORSETTING0 , \ mc13783_violo_val), MC13783_DEFINE_REGU(VDIG, REGULATORMODE0, REGULATORSETTING0, \
@@ -255,7 +255,7 @@ static struct mc13783_regulator mc13783_regulators[] = { mc13783_vesim_val),MC13783_DEFINE_REGU (VCAM ,REGULATORMODE1 ,REGULATORSETTING0 , \ mc13783_vcam_val), -MC13783_FIXED_DEFINE (REGU ,VRFBG ,REGULATORMODE1 , mc13783_vrfbg_val), +MC13783_FIXED_DEFINE (REG ,VRFBG ,REGULATORMODE1 , mc13783_vrfbg_val),MC13783_DEFINE_REGU (VVIB ,REGULATORMODE1 ,REGULATORSETTING1 , \ mc13783_vvib_val), MC13783_DEFINE_REGU(VRF1, REGULATORMODE1, REGULATORSETTING1, \
@@ -266,12 +266,12 @@ static struct mc13783_regulator mc13783_regulators[] = { mc13783_vmmc_val),MC13783_DEFINE_REGU (VMMC2 ,REGULATORMODE1 ,REGULATORSETTING1 , \mc13783_vmmc_val ), -MC13783_GPO_DEFINE (REGU ,GPO1 ,POWERMISC ,mc13783_gpo_val ), -MC13783_GPO_DEFINE (REGU ,GPO2 ,POWERMISC ,mc13783_gpo_val ), -MC13783_GPO_DEFINE (REGU ,GPO3 ,POWERMISC ,mc13783_gpo_val ), -MC13783_GPO_DEFINE (REGU ,GPO4 ,POWERMISC ,mc13783_gpo_val ), -MC13783_GPO_DEFINE (REGU ,PWGT1SPI ,POWERMISC ,mc13783_pwgtdrv_val ), - MC13783_GPO_DEFINE(REGU, PWGT2SPI, POWERMISC, mc13783_pwgtdrv_val), +MC13783_GPO_DEFINE (REG ,GPO1 ,POWERMISC ,mc13783_gpo_val ), +MC13783_GPO_DEFINE (REG ,GPO2 ,POWERMISC ,mc13783_gpo_val ), +MC13783_GPO_DEFINE (REG ,GPO3 ,POWERMISC ,mc13783_gpo_val ), +MC13783_GPO_DEFINE (REG ,GPO4 ,POWERMISC ,mc13783_gpo_val ), +MC13783_GPO_DEFINE (REG ,PWGT1SPI ,POWERMISC ,mc13783_pwgtdrv_val ), + MC13783_GPO_DEFINE(REG, PWGT2SPI, POWERMISC, mc13783_pwgtdrv_val), };struct mc13783_regulator_priv {
@@ -508,8 +508,8 @@ static int mc13783_gpo_regulator_enable(struct regulator_dev *rdev)dev_dbg (rdev_get_dev (rdev),"%s id: %d\n" , __func__, id);/* Power Gate enable value is 0 */ -if (id ==MC13783_REGU_PWGT1SPI || - id ==MC13783_REGU_PWGT2SPI ) +if (id ==MC13783_REG_PWGT1SPI || + id ==MC13783_REG_PWGT2SPI ) en_val =0 ;mc13783_lock (priv->mc13783);
@@ -530,8 +530,8 @@ static int mc13783_gpo_regulator_disable(struct regulator_dev *rdev)dev_dbg (rdev_get_dev (rdev),"%s id: %d\n" , __func__, id);/* Power Gate disable value is 1 */ -if (id ==MC13783_REGU_PWGT1SPI || - id ==MC13783_REGU_PWGT2SPI ) +if (id ==MC13783_REG_PWGT1SPI || + id ==MC13783_REG_PWGT2SPI ) dis_val = mc13783_regulators[id].enable_bit;mc13783_lock (priv->mc13783);
include/linux/mfd/mc13783.h +34 -33
77 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 1/3 Change the register name definitions for mc13783
Quoted 8 lines · yong.shen at freescale.com
From: Yong Shen <[email protected]>
To make mc13783 and mc13892 share code, the register names should be changed to fit the new macro definitions in the comming patch.
Signed-off-by Yong Shen <[email protected]>Acked-by Sascha Hauer <[email protected]>Acked-by Mark Brown <[email protected]>
Quoted 7 lines
--- arch/arm/mach-imx/mach-pcm038.c | 4 +- arch/arm/mach-mx3/mach-mx31_3ds.c | 4 +- arch/arm/mach-mx3/mach-mx31moboard.c | 4 +- drivers/regulator/mc13783-regulator.c | 30 +++++++------- include/linux/mfd/mc13783.h | 67 +++++++++++++++++---------------- 5 files changed, 55 insertions(+), 54 deletions(-)
All applied.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
PATCH 2/3 make mc13783 regulator code generic
In reply to yong.shen at freescale.comFrom: Yong Shen <[email protected]>
move some common functions and micros of mc13783 regulaor driver to a seperate file, which makes it possible for mc13892 to share code.
--- drivers/regulator/Kconfig | 4 + drivers/regulator/Makefile | 1 + drivers/regulator/mc13783-regulator.c | 325 ++++------------------------ drivers/regulator/mc13xxx-regulator-core.c | 234 ++++++++++++++++++++ drivers/regulator/mc13xxx.h | 101 +++++++++ 5 files changed, 383 insertions(+), 282 deletions(-) create mode 100644 drivers/regulator/mc13xxx-regulator-core.c create mode 100644 drivers/regulator/mc13xxx.h
drivers/regulator/Kconfig +4 -0
@@ -186,9 +186,13 @@ config REGULATOR_PCAP This driver provides support for the voltage regulators of the PCAP2 PMIC. +config REGULATOR_MC13XXX_CORE + bool + config REGULATOR_MC13783 tristate "Support regulators on Freescale MC13783 PMIC" depends on MFD_MC13783 + select REGULATOR_MC13XXX_CORE help Say y here to support the regulators found on the Freescale MC13783 PMIC.
drivers/regulator/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o +obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
drivers/regulator/mc13783-regulator.c +43 -282
441 lines not on this page · raw message
drivers/regulator/mc13xxx-regulator-core.c new file +234 -0
234 lines not on this page · raw message
drivers/regulator/mc13xxx.h new file +101 -0
101 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 3/3 regulator: support PMIC mc13892
In reply to yong.shen at freescale.comFrom: Yong Shen <[email protected]>
add support for mc13892, tested on mx51 babbage board
--- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/mc13892-regulator.c | 635 +++++++++++++++++++++++++++++++++ include/linux/mfd/mc13892.h | 39 ++ 4 files changed, 683 insertions(+), 0 deletions(-) create mode 100644 drivers/regulator/mc13892-regulator.c create mode 100644 include/linux/mfd/mc13892.h
drivers/regulator/Kconfig +8 -0
@@ -197,6 +197,14 @@ config REGULATOR_MC13783 Say y here to support the regulators found on the Freescale MC13783 PMIC. +config REGULATOR_MC13892 + tristate "Support regulators on Freescale MC13892 PMIC" + depends on MFD_MC13XXX + select REGULATOR_MC13XXX_CORE + help + Say y here to support the regulators found on the Freescale MC13892 + PMIC. + config REGULATOR_AB3100 tristate "ST-Ericsson AB3100 Regulator functions" depends on AB3100_CORE
drivers/regulator/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o +obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o
drivers/regulator/mc13892-regulator.c new file +635 -0
635 lines not on this page · raw message
include/linux/mfd/mc13892.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright 2010 Yong Shen <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License version 2 as published by the +* Free Software Foundation. +*/ + +#ifndef __LINUX_MFD_MC13892_H +#define __LINUX_MFD_MC13892_H + +#include <linux/mfd/mc13xxx.h> + +#define MC13892_SW1 0 +#define MC13892_SW2 1 +#define MC13892_SW3 2 +#define MC13892_SW4 3 +#define MC13892_SWBST 4 +#define MC13892_VIOHI 5 +#define MC13892_VPLL 6 +#define MC13892_VDIG 7 +#define MC13892_VSD 8 +#define MC13892_VUSB2 9 +#define MC13892_VVIDEO 10 +#define MC13892_VAUDIO 11 +#define MC13892_VCAM 12 +#define MC13892_VGEN1 13 +#define MC13892_VGEN2 14 +#define MC13892_VGEN3 15 +#define MC13892_VUSB 16 +#define MC13892_GPO1 17 +#define MC13892_GPO2 18 +#define MC13892_GPO3 19 +#define MC13892_GPO4 20 +#define MC13892_PWGT1SPI 21 +#define MC13892_PWGT2SPI 22 +#define MC13892_VCOINCELL 23 + +#endif
Signature · 1 line
1.7.0.4
PATCH 3/3 regulator: support PMIC mc13892
Quoted 3 lines · yong.shen at freescale.com
From: Yong Shen <[email protected]>
add support for mc13892, tested on mx51 babbage board