arm: tegratab: Update platform data of max17048
Hyongbin Kim [Tue, 21 May 2013 10:30:54 +0000 (19:30 +0900)]
Update 4100mA battery Model file.
Add gpio irq for detect ALRT of max17048.
use 1% SOC change alert.
use SOC low alert.
Not use voltage high/low alert.
Disable voltage reset alert.
Update board file of not-using DT for reference.

Bug 1293141
Bug 1245249

Change-Id: I5664664ba482d158ab083b8f66b8589a45fc064d
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/231138
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

arch/arm/boot/dts/tegra114-tegratab-common.dtsi
arch/arm/mach-tegra/board-tegratab-power.c

index 2521c1a..4cac15f 100644 (file)
                max17048@36 {
                        compatible = "maxim,max17048";
                        reg = <0x36>;
-                       alert-threshold = <0>;
+                       interrupt-parent = <&gpio>;
+                       interrupts = <133 0x04>;        /* gpio PQ5 */
+                       alert-threshold = <1>;          /* 1% SOC */
                        one-percent-alerts = <1>;
-                       valert-max = <4240>;
-                       valert-min = <3400>;
+                       valert-max = <5100>;            /* not use */
+                       valert-min = <0>;               /* not use */
                        vreset-threshold = <2400>;
-                       vreset-disable = <0>;
-                       hib-threshold = <48>; /* 9.984%/hr */
-                       hib-active-threshold = <128>; /* 160mV */
-                       bits = <19>;
-                       rcomp = <102>;
-                       rcomp-seg = <0x0080>;
-                       soccheck-a = <237>;
-                       soccheck-b = <239>;
+                       vreset-disable = <1>;           /* not use */
+                       hib-threshold = <48>;           /* 9.984%/hr */
+                       hib-active-threshold = <128>;   /* 160mV */
+                       bits = <18>;
+                       rcomp = <57>;
+                       rcomp-seg = <0x0200>;
+                       soccheck-a = <119>;
+                       soccheck-b = <121>;
                        ocvtest = <55952>;
-                       data-tbl = <0x98 0x60 0xB0 0xC0 0xB7 0xB0 0xBA 0x10
-                               0xBB 0xE0 0xBC 0x10 0xBC 0xC0 0xBD 0xF0
-                               0xBF 0x00 0xC0 0x10 0xC1 0xF0 0xC4 0x00
-                               0xC6 0x70 0xC8 0xE0 0xCA 0x80 0xD0 0x90
-                               0x00 0x80 0x06 0xA0 0x21 0x40 0x22 0x80
-                               0x49 0x90 0x6C 0x80 0x45 0xA0 0x2D 0xE0
-                               0x2D 0xC0 0x17 0x80 0x1A 0x00 0x18 0xA0
-                               0x18 0x20 0x15 0x40 0x0E 0xA0 0x0E 0xA0>;
+                       data-tbl = <0x98 0x80 0xB3 0x50 0xB7 0x90 0xB9 0x00
+                               0xBA 0x70 0xBC 0x10 0xBC 0x50 0xBC 0xA0
+                               0xBD 0x20 0xBE 0x30 0xBF 0x40 0xC2 0xF0
+                               0xC4 0x20 0xC7 0xE0 0xCB 0xF0 0xD0 0x90
+                               0x00 0x40 0x06 0x70 0x0E 0x50 0x12 0x00
+                               0x18 0xD0 0x33 0x10 0x31 0x40 0x35 0xD0
+                               0x18 0xD0 0x19 0x00 0x0B 0xF0 0x0C 0x10
+                               0x0D 0x10 0x07 0x90 0x08 0x00 0x08 0x00>;
                };
        };
 
index ab5d8c8..8f5b26c 100644 (file)
@@ -86,27 +86,27 @@ struct bq2419x_charger_platform_data tegratab_bq2419x_charger_pdata = {
 
 #ifndef CONFIG_OF
 struct max17048_battery_model tegratab_max17048_mdata = {
-       .rcomp          = 152,
-       .soccheck_A     = 206,
-       .soccheck_B     = 208,
-       .bits           = 19,
-       .alert_threshold = 0x00,
+       .rcomp          = 57,
+       .soccheck_A     = 119,
+       .soccheck_B     = 121,
+       .bits           = 18,
+       .alert_threshold = 0x01,        /* 1% SOC */
        .one_percent_alerts = 0x40,
-       .alert_on_reset = 0x40,
-       .rcomp_seg      = 0x0080,
+       .alert_on_reset = 0x00,         /* not use */
+       .rcomp_seg      = 0x0200,
        .hibernate      = 0x3080,
        .vreset         = 0x3c96,
-       .valert         = 0xD4AA,
-       .ocvtest        = 55744,
+       .valert         = 0x00FF,       /* not use */
+       .ocvtest        = 55952,
        .data_tbl = {
-               0xA2, 0x80, 0xA8, 0xF0, 0xAE, 0xD0, 0xB0, 0x90,
-               0xB2, 0x60, 0xB3, 0xF0, 0xB5, 0x80, 0xB7, 0x20,
-               0xB8, 0xD0, 0xBC, 0x00, 0xBE, 0x20, 0xC0, 0x20,
-               0xC3, 0xD0, 0xC9, 0x80, 0xCE, 0xA0, 0xCF, 0xC0,
-               0x0A, 0x60, 0x0D, 0xE0, 0x1D, 0x00, 0x1D, 0xE0,
-               0x1F, 0xE0, 0x1F, 0xE0, 0x11, 0xC0, 0x11, 0x20,
-               0x14, 0x60, 0x0B, 0xE0, 0x14, 0x80, 0x14, 0xC0,
-               0x0E, 0x20, 0x12, 0xA0, 0x03, 0x60, 0x03, 0x60,
+               0x98, 0x80, 0xB3, 0x50, 0xB7, 0x90, 0xB9, 0x00,
+               0xBA, 0x70, 0xBC, 0x10, 0xBC, 0x50, 0xBC, 0xA0,
+               0xBD, 0x20, 0xBE, 0x30, 0xBF, 0x40, 0xC2, 0xF0,
+               0xC4, 0x20, 0xC7, 0xE0, 0xCB, 0xF0, 0xD0, 0x90,
+               0x00, 0x40, 0x06, 0x70, 0x0E, 0x50, 0x12, 0x00,
+               0x18, 0xD0, 0x33, 0x10, 0x31, 0x40, 0x35, 0xD0,
+               0x18, 0xD0, 0x19, 0x00, 0x0B, 0xF0, 0x0C, 0x10,
+               0x0D, 0x10, 0x07, 0x90, 0x08, 0x00, 0x08, 0x00,
        },
 };
 
@@ -664,6 +664,7 @@ int __init tegratab_regulator_init(void)
 #endif
        tegratab_palmas_regulator_init();
 #ifndef CONFIG_OF
+       tegratab_max17048_boardinfo[0].irq = gpio_to_irq(TEGRA_GPIO_PQ5);
        i2c_register_board_info(0, tegratab_max17048_boardinfo, 1);
 #endif
        /* Disable charger when adapter is power source. */