4 * Copyright (C) 2011 Texas Instruments, Inc..
5 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 #include <linux/i2c.h>
24 #include <linux/i2c/twl.h>
25 #include <linux/gpio.h>
26 #include <linux/string.h>
27 #include <linux/phy/phy.h>
28 #include <linux/regulator/machine.h>
29 #include <linux/regulator/fixed.h>
32 #include "twl-common.h"
37 static struct i2c_board_info __initdata pmic_i2c_board_info = {
39 .flags = I2C_CLIENT_WAKE,
42 void __init omap_pmic_init(int bus, u32 clkrate,
43 const char *pmic_type, int pmic_irq,
44 struct twl4030_platform_data *pmic_data)
46 omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
47 strlcpy(pmic_i2c_board_info.type, pmic_type,
48 sizeof(pmic_i2c_board_info.type));
49 pmic_i2c_board_info.irq = pmic_irq;
50 pmic_i2c_board_info.platform_data = pmic_data;
52 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
55 void __init omap_pmic_late_init(void)
57 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
58 if (!pmic_i2c_board_info.irq)
65 #if IS_ENABLED(CONFIG_SND_OMAP_SOC_OMAP_TWL4030)
66 #include <linux/platform_data/omap-twl4030.h>
68 /* Commonly used configuration */
69 static struct omap_tw4030_pdata omap_twl4030_audio_data;
71 static struct platform_device audio_device = {
72 .name = "omap-twl4030",
76 void omap_twl4030_audio_init(char *card_name,
77 struct omap_tw4030_pdata *pdata)
80 pdata = &omap_twl4030_audio_data;
82 pdata->card_name = card_name;
84 audio_device.dev.platform_data = pdata;
85 platform_device_register(&audio_device);
88 #else /* SOC_OMAP_TWL4030 */
89 void omap_twl4030_audio_init(char *card_name,
90 struct omap_tw4030_pdata *pdata)
94 #endif /* SOC_OMAP_TWL4030 */