* [PATCH 2/5] Regulator: Creating regulator hookup file for OMAP3 platforms
@ 2009-11-05 16:39 Anuj Aggarwal
2009-11-05 16:58 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Anuj Aggarwal @ 2009-11-05 16:39 UTC (permalink / raw)
To: linux-omap; +Cc: broonie, lrg, Anuj Aggarwal
This newly created board-omap35x-pmic.c will be used to provide
the board specific regulator hookup code for various TI PMICs (like
TWL4030/TPS65950, TPS65023) on different EVMs like OMAP3, AM3517.
PMIC initialization routine is called from the board-evm file
which will initialize the configured PMIC appropriately.
Signed-off-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
---
arch/arm/mach-omap2/board-omap35x-pmic.c | 71 ++++++++++++++++++++++++++++++
arch/arm/mach-omap2/board-omap3evm.c | 8 +++
2 files changed, 79 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/board-omap35x-pmic.c
diff --git a/arch/arm/mach-omap2/board-omap35x-pmic.c b/arch/arm/mach-omap2/board-omap35x-pmic.c
new file mode 100644
index 0000000..aae07ab
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap35x-pmic.c
@@ -0,0 +1,71 @@
+/*
+ * board-omap35x-pmic.c
+ *
+ * Board specific information for different regulators and platforms.
+ *
+ * Copyright (C) 2009 Texas Instrument Incorporated - http://www.ti.com/
+ *
+ * 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 version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+#include <linux/platform_device.h>
+#include <plat/common.h>
+
+/*
+ * Definitions specific to TWL4030/TPS65950
+ */
+#if defined(CONFIG_PMIC_TWL4030)
+static inline void pmic_twl4030_init(void)
+{
+ /* TWL4030 specific init code */
+}
+#else
+static inline void pmic_twl4030_init(void)
+{
+}
+#endif /* CONFIG_PMIC_TWL4030 */
+
+/*
+ * Definitions specific to TPS65023
+ */
+#if defined(CONFIG_PMIC_TPS65023)
+static inline void pmic_tps65023_init(void)
+{
+ /* TPS65023 specific init code */
+}
+#else
+static inline void pmic_tps65023_init(void)
+{
+}
+#endif /* CONFIG_PMIC_TPS65023 */
+
+/*
+ * Definitions specific to TPS65073
+ */
+#if defined(CONFIG_PMIC_TPS65073)
+static inline void pmic_tps65073_init(void)
+{
+ /* TPS65073 specific init code */
+}
+#else
+static inline void pmic_tps65073_init(void)
+{
+}
+#endif /* CONFIG_PMIC_TPS65073 */
+
+/* Detects the PMIC and initializes it accordingly */
+void omap35x_pmic_init(void)
+{
+ pmic_twl4030_init();
+ pmic_tps65023_init();
+ pmic_tps65073_init();
+}
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index d526fa5..dbdf062 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -51,6 +51,8 @@
#define OMAP3EVM_ETHR_GPIO_IRQ 176
#define OMAP3EVM_SMC911X_CS 5
+extern void omap35x_pmic_init(void);
+
static struct resource omap3evm_smc911x_resources[] = {
[0] = {
.start = OMAP3EVM_ETHR_START,
@@ -204,6 +206,10 @@ static struct twl4030_platform_data omap3evm_twldata = {
.madc = &omap3evm_madc_data,
.usb = &omap3evm_usb_data,
.gpio = &omap3evm_gpio_data,
+ /*
+ * Regulator specific hooks are getting populated
+ * in the omap35x_pmic_init().
+ */
};
static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
@@ -312,6 +318,8 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static void __init omap3_evm_init(void)
{
+ omap35x_pmic_init();
+
omap3_evm_i2c_init();
platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
--
1.6.2.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/5] Regulator: Creating regulator hookup file for OMAP3 platforms
2009-11-05 16:39 [PATCH 2/5] Regulator: Creating regulator hookup file for OMAP3 platforms Anuj Aggarwal
@ 2009-11-05 16:58 ` Liam Girdwood
0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2009-11-05 16:58 UTC (permalink / raw)
To: Anuj Aggarwal; +Cc: linux-omap, broonie
On Thu, 2009-11-05 at 22:09 +0530, Anuj Aggarwal wrote:
> This newly created board-omap35x-pmic.c will be used to provide
> the board specific regulator hookup code for various TI PMICs (like
> TWL4030/TPS65950, TPS65023) on different EVMs like OMAP3, AM3517.
>
> PMIC initialization routine is called from the board-evm file
> which will initialize the configured PMIC appropriately.
>
> Signed-off-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
> ---
> arch/arm/mach-omap2/board-omap35x-pmic.c | 71 ++++++++++++++++++++++++++++++
> arch/arm/mach-omap2/board-omap3evm.c | 8 +++
> 2 files changed, 79 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-omap2/board-omap35x-pmic.c
>
> diff --git a/arch/arm/mach-omap2/board-omap35x-pmic.c b/arch/arm/mach-omap2/board-omap35x-pmic.c
> new file mode 100644
> index 0000000..aae07ab
> --- /dev/null
> +++ b/arch/arm/mach-omap2/board-omap35x-pmic.c
> @@ -0,0 +1,71 @@
> +/*
> + * board-omap35x-pmic.c
> + *
> + * Board specific information for different regulators and platforms.
> + *
> + * Copyright (C) 2009 Texas Instrument Incorporated - http://www.ti.com/
> + *
> + * 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 version 2.
> + *
> + * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
> + * whether express or implied; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * General Public License for more details.
> + */
> +
> +#include <linux/regulator/driver.h>
> +#include <linux/regulator/machine.h>
> +#include <linux/platform_device.h>
> +#include <plat/common.h>
> +
> +/*
> + * Definitions specific to TWL4030/TPS65950
> + */
> +#if defined(CONFIG_PMIC_TWL4030)
> +static inline void pmic_twl4030_init(void)
> +{
> + /* TWL4030 specific init code */
Would this not be per board per pmic i.e.
pmic_x_board_y_init() ?
I can see pmic init sometimes being different across boards here (for
the same pmic). Although this probably depends on how complex/flexible
your pmic init needs to be in the first place.
Liam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-05 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-05 16:39 [PATCH 2/5] Regulator: Creating regulator hookup file for OMAP3 platforms Anuj Aggarwal
2009-11-05 16:58 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox