extcon: madera: Add HPDET calibrations for CS47L15
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 1 Mar 2018 15:28:05 +0000 (15:28 +0000)
committer강신형 <s47.kang@samsung.com>
Tue, 19 Jun 2018 07:58:27 +0000 (16:58 +0900)
Change-Id: Ic9918418c5a7adea755af1395b2edd2dac6c2401
Signed-off-by: Jaswinder Jassal <jjassal@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
drivers/extcon/extcon-madera.c

index c8d5fb3db5c28ce41451c914ee1c419725bbd344..2bbb91f8bb9971e88792f9598ff071c332a11152 100644 (file)
@@ -119,6 +119,17 @@ struct madera_hpdet_calibration_data {
        s64     dacval_adjust;
 };
 
+static const struct madera_hpdet_calibration_data cs47l15_hpdet_ranges[] = {
+       {},
+       { 33,   123,   1000000,   -4300,   7975, 69600000, 382800, 33350000,
+         500000},
+       { 123,  1033,  9633000,   -79500,  7300, 62900000, 283050, 33350000,
+         500000},
+       { 1033, 10033, 100684000, -949400, 7300, 63200000, 284400, 33350000,
+         500000},
+};
+
+
 static const struct madera_hpdet_calibration_data cs47l85_hpdet_ranges[] = {
        { 4,    30,    1007000,   -7200,   4003, 69300000, 381150, 250000, 500000},
        { 8,    100,   1007000,   -7200,   7975, 69600000, 382800, 250000, 500000},
@@ -3078,6 +3089,13 @@ static int madera_extcon_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, info);
 
        switch (madera->type) {
+       case CS47L15:
+               info->hpdet_init_range = 1; /* range 0 not used on CS47L15 */
+               info->hpdet_ranges = cs47l15_hpdet_ranges;
+               info->num_hpdet_ranges = ARRAY_SIZE(cs47l15_hpdet_ranges);
+               info->micd_modes = madera_micd_default_modes;
+               info->num_micd_modes = ARRAY_SIZE(madera_micd_default_modes);
+               break;
        case CS47L35:
                pdata->micd_force_micbias = true;
                info->hpdet_ranges = cs47l85_hpdet_ranges;
@@ -3099,9 +3117,6 @@ static int madera_extcon_probe(struct platform_device *pdev)
                info->micd_modes = madera_micd_default_modes;
                info->num_micd_modes = ARRAY_SIZE(madera_micd_default_modes);
                break;
-       case CS47L15:
-               info->hpdet_init_range = 1; /* range 0 not used on CS47L15 */
-               /* fall through to default case */
        default:
                info->hpdet_ranges = madera_hpdet_ranges;
                info->num_hpdet_ranges = ARRAY_SIZE(madera_hpdet_ranges);