From: Charles Keepax Date: Thu, 1 Mar 2018 15:28:05 +0000 (+0000) Subject: extcon: madera: Add HPDET calibrations for CS47L15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0ed1d34da327b201e4c5149d576fd6375196df65;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git extcon: madera: Add HPDET calibrations for CS47L15 Change-Id: Ic9918418c5a7adea755af1395b2edd2dac6c2401 Signed-off-by: Jaswinder Jassal Signed-off-by: Charles Keepax --- diff --git a/drivers/extcon/extcon-madera.c b/drivers/extcon/extcon-madera.c index c8d5fb3db5c2..2bbb91f8bb99 100644 --- a/drivers/extcon/extcon-madera.c +++ b/drivers/extcon/extcon-madera.c @@ -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);