aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2014-11-10 15:34:43 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-14 15:13:25 -0500
commit68a3c0433077b189e5adf3b267cd8db9b8b78d24 (patch)
tree98f654b0ecaf386b945791d74958d36acac66e28
parent5325d844fdae416993c41271a6460fd1c81c6172 (diff)
[media] ARM: OMAP2: RX-51: update si4713 platform data
This updates platform data related to Si4713, which has been updated to be compatible with DT interface. Signed-off-by: Sebastian Reichel <sre@kernel.org> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c69
1 files changed, 31 insertions, 38 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index ddfc8df83c6a..ec2e4101988b 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -23,6 +23,7 @@
23#include <linux/regulator/machine.h> 23#include <linux/regulator/machine.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/gpio/machine.h>
26#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
27#include <linux/power/isp1704_charger.h> 28#include <linux/power/isp1704_charger.h>
28#include <linux/platform_data/spi-omap2-mcspi.h> 29#include <linux/platform_data/spi-omap2-mcspi.h>
@@ -38,7 +39,6 @@
38 39
39#include <sound/tlv320aic3x.h> 40#include <sound/tlv320aic3x.h>
40#include <sound/tpa6130a2-plat.h> 41#include <sound/tpa6130a2-plat.h>
41#include <media/radio-si4713.h>
42#include <media/si4713.h> 42#include <media/si4713.h>
43#include <linux/platform_data/leds-lp55xx.h> 43#include <linux/platform_data/leds-lp55xx.h>
44 44
@@ -760,46 +760,17 @@ static struct regulator_init_data rx51_vintdig = {
760 }, 760 },
761}; 761};
762 762
763static const char * const si4713_supply_names[] = { 763static struct gpiod_lookup_table rx51_fmtx_gpios_table = {
764 "vio", 764 .dev_id = "2-0063",
765 "vdd", 765 .table = {
766}; 766 GPIO_LOOKUP("gpio.6", 3, "reset", GPIO_ACTIVE_HIGH), /* 163 */
767 767 { },
768static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = {
769 .supplies = ARRAY_SIZE(si4713_supply_names),
770 .supply_names = si4713_supply_names,
771 .gpio_reset = RX51_FMTX_RESET_GPIO,
772};
773
774static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = {
775 I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH),
776 .platform_data = &rx51_si4713_i2c_data,
777};
778
779static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = {
780 .i2c_bus = 2,
781 .subdev_board_info = &rx51_si4713_board_info,
782};
783
784static struct platform_device rx51_si4713_dev __initdata_or_module = {
785 .name = "radio-si4713",
786 .id = -1,
787 .dev = {
788 .platform_data = &rx51_si4713_data,
789 }, 768 },
790}; 769};
791 770
792static __init void rx51_init_si4713(void) 771static __init void rx51_gpio_init(void)
793{ 772{
794 int err; 773 gpiod_add_lookup_table(&rx51_fmtx_gpios_table);
795
796 err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq");
797 if (err) {
798 printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err);
799 return;
800 }
801 rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ);
802 platform_device_register(&rx51_si4713_dev);
803} 774}
804 775
805static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) 776static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
@@ -1029,7 +1000,17 @@ static struct aic3x_pdata rx51_aic3x_data2 = {
1029 .gpio_reset = 60, 1000 .gpio_reset = 60,
1030}; 1001};
1031 1002
1003static struct si4713_platform_data rx51_si4713_platform_data = {
1004 .is_platform_device = true
1005};
1006
1032static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { 1007static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
1008#if IS_ENABLED(CONFIG_I2C_SI4713) && IS_ENABLED(CONFIG_PLATFORM_SI4713)
1009 {
1010 I2C_BOARD_INFO("si4713", 0x63),
1011 .platform_data = &rx51_si4713_platform_data,
1012 },
1013#endif
1033 { 1014 {
1034 I2C_BOARD_INFO("tlv320aic3x", 0x18), 1015 I2C_BOARD_INFO("tlv320aic3x", 0x18),
1035 .platform_data = &rx51_aic3x_data, 1016 .platform_data = &rx51_aic3x_data,
@@ -1070,6 +1051,10 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_3[] = {
1070 1051
1071static int __init rx51_i2c_init(void) 1052static int __init rx51_i2c_init(void)
1072{ 1053{
1054#if IS_ENABLED(CONFIG_I2C_SI4713) && IS_ENABLED(CONFIG_PLATFORM_SI4713)
1055 int err;
1056#endif
1057
1073 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) || 1058 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
1074 system_rev >= SYSTEM_REV_B_USES_VAUX3) { 1059 system_rev >= SYSTEM_REV_B_USES_VAUX3) {
1075 rx51_twldata.vaux3 = &rx51_vaux3_mmc; 1060 rx51_twldata.vaux3 = &rx51_vaux3_mmc;
@@ -1087,6 +1072,14 @@ static int __init rx51_i2c_init(void)
1087 rx51_twldata.vdac->constraints.name = "VDAC"; 1072 rx51_twldata.vdac->constraints.name = "VDAC";
1088 1073
1089 omap_pmic_init(1, 2200, "twl5030", 7 + OMAP_INTC_START, &rx51_twldata); 1074 omap_pmic_init(1, 2200, "twl5030", 7 + OMAP_INTC_START, &rx51_twldata);
1075#if IS_ENABLED(CONFIG_I2C_SI4713) && IS_ENABLED(CONFIG_PLATFORM_SI4713)
1076 err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq");
1077 if (err) {
1078 printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err);
1079 return err;
1080 }
1081 rx51_peripherals_i2c_board_info_2[0].irq = gpio_to_irq(RX51_FMTX_IRQ);
1082#endif
1090 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 1083 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
1091 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 1084 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
1092#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) 1085#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
@@ -1300,6 +1293,7 @@ static void __init rx51_init_omap3_rom_rng(void)
1300 1293
1301void __init rx51_peripherals_init(void) 1294void __init rx51_peripherals_init(void)
1302{ 1295{
1296 rx51_gpio_init();
1303 rx51_i2c_init(); 1297 rx51_i2c_init();
1304 regulator_has_full_constraints(); 1298 regulator_has_full_constraints();
1305 gpmc_onenand_init(board_onenand_data); 1299 gpmc_onenand_init(board_onenand_data);
@@ -1307,7 +1301,6 @@ void __init rx51_peripherals_init(void)
1307 rx51_add_gpio_keys(); 1301 rx51_add_gpio_keys();
1308 rx51_init_wl1251(); 1302 rx51_init_wl1251();
1309 rx51_init_tsc2005(); 1303 rx51_init_tsc2005();
1310 rx51_init_si4713();
1311 rx51_init_lirc(); 1304 rx51_init_lirc();
1312 spi_register_board_info(rx51_peripherals_spi_board_info, 1305 spi_register_board_info(rx51_peripherals_spi_board_info,
1313 ARRAY_SIZE(rx51_peripherals_spi_board_info)); 1306 ARRAY_SIZE(rx51_peripherals_spi_board_info));