},
};
+/* I2C2 (Fuel Gauge) */
+static struct max17042_reg_data max17042_init_data[] = {
+ { MAX17042_CGAIN, 0x0000 },
+ { MAX17042_MiscCFG, 0x0003 },
+ { MAX17042_LearnCFG, 0x0007 },
+ /* RCOMP: 0x0050 2011.02.29 from MAXIM */
+ { MAX17042_RCOMP0, 0x0050 },
+};
+
+/* Alert only when the battery is removed or inserted */
+static struct max17042_reg_data max17042_alert_init_data[] = {
+ /* SALRT Threshold setting (disable) unsigned MAX/MIN */
+ { MAX17042_SALRT_Th, 0xFF00 },
+ /* VALRT Threshold setting (disable) unsigned MAX/MIN */
+ { MAX17042_VALRT_Th, 0xFF00 },
+ /* TALRT Threshold setting (disable) signed MAX/MIN */
+ { MAX17042_TALRT_Th, 0x7F80 },
+};
+
+static struct max17042_platform_data tizen_battery_platform_data = {
+ .init_data = max17042_init_data,
+ .num_init_data = ARRAY_SIZE(max17042_init_data),
+ .alrt_data = max17042_alert_init_data,
+ .num_alrt_data = ARRAY_SIZE(max17042_alert_init_data),
+// .irq_base = IRQ_FUEL_BASE,
+ .enable_alert = true,
+ .wakeup = true,
+ .r_sns = 10000, /* 10m Ohm */
+};
+
+static struct s3c2410_platform_i2c i2c2_data __initdata = {
+ .flags = 0,
+ .bus_num = 2,
+ .slave_addr = 0x10,
+ .frequency = 400000U,
+ .sda_delay = 200,
+};
+
+static struct i2c_board_info i2c2_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("max17042", 0x36),
+ .platform_data = &tizen_battery_platform_data,
+ },
+};
+
/* TSP */
static struct mxt_platform_data mxt_platform_data = {
.x_line = 18,
},
};
-static struct max17042_platform_data tizen_battery_platform_data = {
-};
-
-/* GPIO I2C 9 (Fuel Gauge) */
-static struct i2c_gpio_platform_data i2c9_gpio_data = {
- .sda_pin = EXYNOS4_GPY4(0), /* XM0ADDR_8 */
- .scl_pin = EXYNOS4_GPY4(1), /* XM0ADDR_9 */
-};
-static struct platform_device i2c9_gpio = {
- .name = "i2c-gpio",
- .id = 9,
- .dev = {
- .platform_data = &i2c9_gpio_data,
- },
-};
-enum { I2C9_MAX17042};
-static struct i2c_board_info i2c9_devs[] __initdata = {
- [I2C9_MAX17042] = {
- I2C_BOARD_INFO("max17042", 0x36),
- .platform_data = &tizen_battery_platform_data,
- },
-};
-
/* MAX8903 Secondary Charger */
static struct regulator_consumer_supply supplies_max8903[] = {
REGULATOR_SUPPLY("vinchg2", "charger-manager.0"),
&s3c_device_timer[0],
&s5p_device_ehci,
&s3c_device_i2c3,
- &i2c9_gpio,
&s3c_device_adc,
&s5p_device_g2d,
&s5p_device_jpeg,
&cam_8m_12v_fixed_rdev,
&exynos4_bus_devfreq,
&s3c_device_i2c1,
+ &s3c_device_i2c2,
&exynos4_device_i2s0,
&samsung_asoc_idma,
};
s3c_i2c0_set_platdata(&tizen_i2c0_platdata);
s3c_i2c1_set_platdata(NULL);
i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
+ s3c_i2c2_set_platdata(&i2c2_data);
+ i2c_register_board_info(2, i2c2_devs, ARRAY_SIZE(i2c2_devs));
s3c_i2c3_set_platdata(&i2c3_data);
i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
s3c_i2c5_set_platdata(NULL);
i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7));
i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
- i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3));
- i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
s3c_i2c6_set_platdata(&tizen_i2c6_platdata);
s5p_fimd0_set_platdata(&tizen_fb_pdata);