From 20831061d8cec4ec537fada6b9abe263e208b4ae Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 20 Mar 2012 11:40:06 +0000 Subject: pmic: Add support for the Dialog DA9053 PMIC Add support for the Dialog DA9053 PMIC. Signed-off-by: Fabio Estevam --- drivers/misc/pmic_dialog.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 drivers/misc/pmic_dialog.c (limited to 'drivers/misc/pmic_dialog.c') diff --git a/drivers/misc/pmic_dialog.c b/drivers/misc/pmic_dialog.c new file mode 100644 index 0000000000..724207349c --- /dev/null +++ b/drivers/misc/pmic_dialog.c @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 Samsung Electronics + * Lukasz Majewski + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include + +int pmic_init(void) +{ + struct pmic *p = get_pmic(); + static const char name[] = "DIALOG_PMIC"; + + p->name = name; + p->number_of_regs = PMIC_NUM_OF_REGS; + + p->interface = PMIC_I2C; + p->hw.i2c.addr = CONFIG_SYS_DIALOG_PMIC_I2C_ADDR; + p->hw.i2c.tx_num = 1; + p->bus = I2C_PMIC; + + return 0; +} -- cgit v1.2.3 From ed5157e8895a6bf59a8163329639e34db0702331 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 7 May 2012 10:25:58 +0000 Subject: pmic: dialog: Avoid name conflicts As mx53loco board has two variants: one with Dialog PMIC and another with FSL MC34708 PMIC, we need to be able to build both drivers. Change pmic_init() and PMIC_NUM_OF_REGS names to avoid build conflicts when both drivers are present. Signed-off-by: Fabio Estevam Acked-by: Stefano Babic --- board/freescale/mx53loco/mx53loco.c | 2 +- drivers/misc/pmic_dialog.c | 4 ++-- include/dialog_pmic.h | 2 +- include/pmic.h | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/misc/pmic_dialog.c') diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 0dcec9b987..7ed5c4e4da 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -322,7 +322,7 @@ static int power_init(void) unsigned int val, ret; struct pmic *p; - pmic_init(); + pmic_dialog_init(); p = get_pmic(); /* Set VDDA to 1.25V */ diff --git a/drivers/misc/pmic_dialog.c b/drivers/misc/pmic_dialog.c index 724207349c..e97af1d1d0 100644 --- a/drivers/misc/pmic_dialog.c +++ b/drivers/misc/pmic_dialog.c @@ -20,13 +20,13 @@ #include #include -int pmic_init(void) +int pmic_dialog_init(void) { struct pmic *p = get_pmic(); static const char name[] = "DIALOG_PMIC"; p->name = name; - p->number_of_regs = PMIC_NUM_OF_REGS; + p->number_of_regs = DIALOG_NUM_OF_REGS; p->interface = PMIC_I2C; p->hw.i2c.addr = CONFIG_SYS_DIALOG_PMIC_I2C_ADDR; diff --git a/include/dialog_pmic.h b/include/dialog_pmic.h index b0925f5ce7..8d43585e24 100644 --- a/include/dialog_pmic.h +++ b/include/dialog_pmic.h @@ -164,7 +164,7 @@ enum { DA9053_GPID7_REG, DA9053_GPID8_REG, DA9053_GPID9_REG, - PMIC_NUM_OF_REGS, + DIALOG_NUM_OF_REGS, }; #define DA_BUCKCORE_VBCORE_1_250V 0x1E diff --git a/include/pmic.h b/include/pmic.h index 52a1526d95..6a05b40aef 100644 --- a/include/pmic.h +++ b/include/pmic.h @@ -55,6 +55,7 @@ struct pmic { }; int pmic_init(void); +int pmic_dialog_init(void); int check_reg(u32 reg); struct pmic *get_pmic(void); int pmic_probe(struct pmic *p); -- cgit v1.2.3