Bugzilla – Attachment 728062 Details for
Bug 1043231
Kernel build failed at armv7hl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
0004-extcon-adc-jack-Remove-the-usage-of-extcon_set_state.patch
0004-extcon-adc-jack-Remove-the-usage-of-extcon_set_state.patch (text/plain), 3.77 KB, created by
Matwey Kornilov
on 2017-06-07 19:34:56 UTC
(
hide
)
Description:
0004-extcon-adc-jack-Remove-the-usage-of-extcon_set_state.patch
Filename:
MIME Type:
Creator:
Matwey Kornilov
Created:
2017-06-07 19:34:56 UTC
Size:
3.77 KB
patch
obsolete
>From 074428dc82f24a560dc66046d434442e0a94e2cb Mon Sep 17 00:00:00 2001 >From: Chanwoo Choi <cw00.choi@samsung.com> >Date: Mon, 18 Jul 2016 16:16:29 +0900 >Subject: [PATCH 04/19] extcon: adc-jack: Remove the usage of > extcon_set_state() > >This patch removes the usage of extcon_set_state() because it uses the bit >masking to change the state of external connectors. The extcon framework >should handle the state by extcon_set/get_cable_state_() with extcon id. > >Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> >Git-commit: a7da72eeec78b8ce08a99d132b3e269942b977eb >Patch-mainline: v4.9-rc1 >Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> >--- > drivers/extcon/extcon-adc-jack.c | 26 ++++++++++++++------------ > include/linux/extcon/extcon-adc-jack.h | 4 ++-- > 2 files changed, 16 insertions(+), 14 deletions(-) > >diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c >index 7fc0ae1912f8..8df3eea9e6cb 100644 >--- a/drivers/extcon/extcon-adc-jack.c >+++ b/drivers/extcon/extcon-adc-jack.c >@@ -3,6 +3,9 @@ > * > * Analog Jack extcon driver with ADC-based detection capability. > * >+ * Copyright (C) 2016 Samsung Electronics >+ * Chanwoo Choi <cw00.choi@samsung.com> >+ * > * Copyright (C) 2012 Samsung Electronics > * MyungJoo Ham <myungjoo.ham@samsung.com> > * >@@ -56,7 +59,7 @@ static void adc_jack_handler(struct work_struct *work) > struct adc_jack_data *data = container_of(to_delayed_work(work), > struct adc_jack_data, > handler); >- u32 state = 0; >+ struct adc_jack_cond *def; > int ret, adc_val; > int i; > >@@ -68,17 +71,18 @@ static void adc_jack_handler(struct work_struct *work) > > /* Get state from adc value with adc_conditions */ > for (i = 0; i < data->num_conditions; i++) { >- struct adc_jack_cond *def = &data->adc_conditions[i]; >- if (!def->state) >- break; >+ def = &data->adc_conditions[i]; > if (def->min_adc <= adc_val && def->max_adc >= adc_val) { >- state = def->state; >- break; >+ extcon_set_cable_state_(data->edev, def->id, true); >+ return; > } > } >- /* if no def has met, it means state = 0 (no cables attached) */ > >- extcon_set_state(data->edev, state); >+ /* Set the detached state if adc value is not included in the range */ >+ for (i = 0; i < data->num_conditions; i++) { >+ def = &data->adc_conditions[i]; >+ extcon_set_cable_state_(data->edev, def->id, false); >+ } > } > > static irqreturn_t adc_jack_irq_thread(int irq, void *_data) >@@ -111,16 +115,14 @@ static int adc_jack_probe(struct platform_device *pdev) > return -ENOMEM; > } > >- if (!pdata->adc_conditions || >- !pdata->adc_conditions[0].state) { >+ if (!pdata->adc_conditions) { > dev_err(&pdev->dev, "error: adc_conditions not defined.\n"); > return -EINVAL; > } > data->adc_conditions = pdata->adc_conditions; > > /* Check the length of array and set num_conditions */ >- for (i = 0; data->adc_conditions[i].state; i++) >- ; >+ for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++); > data->num_conditions = i; > > data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel); >diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h >index 53c60806bcfb..9666a8830758 100644 >--- a/include/linux/extcon/extcon-adc-jack.h >+++ b/include/linux/extcon/extcon-adc-jack.h >@@ -20,8 +20,8 @@ > > /** > * struct adc_jack_cond - condition to use an extcon state >- * @state: the corresponding extcon state (if 0, this struct > * denotes the last adc_jack_cond element among the array) >+ * @id: the unique id of each external connector > * @min_adc: min adc value for this condition > * @max_adc: max adc value for this condition > * >@@ -33,7 +33,7 @@ > * because when no adc_jack_cond is met, state = 0 is automatically chosen. > */ > struct adc_jack_cond { >- u32 state; /* extcon state value. 0 if invalid */ >+ unsigned int id; > u32 min_adc; > u32 max_adc; > }; >-- >2.12.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 1043231
:
728059
|
728060
|
728061
| 728062 |
728063
|
728064
|
728065
|
728066
|
728067
|
728068
|
728069
|
728070
|
728071
|
728072
|
728073
|
728074
|
728075
|
728076
|
728077
|
728521
|
728695
|
728770