From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <cw00.choi@samsung.com>
Cc: <myungjoo.ham@samsung.com>, <patches@opensource.cirrus.com>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 03/10] extcon: arizona: Move pdata extraction to probe
Date: Mon, 9 Dec 2019 11:09:09 +0000 [thread overview]
Message-ID: <20191209110916.29524-3-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20191209110916.29524-1-ckeepax@opensource.cirrus.com>
It makes no sense to be extracting values from pdata for the first time
in the jack detection handler function, move this to probe time where it
belongs.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/extcon/extcon-arizona.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index a8b0bc2d4323b..121c417069478 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -77,8 +77,6 @@ struct arizona_extcon_info {
const struct arizona_micd_range *micd_ranges;
int num_micd_ranges;
- int micd_timeout;
-
bool micd_reva;
bool micd_clamp;
@@ -1016,7 +1014,7 @@ static void arizona_micd_detect(struct work_struct *work)
queue_delayed_work(system_power_efficient_wq,
&info->micd_timeout_work,
- msecs_to_jiffies(info->micd_timeout));
+ msecs_to_jiffies(arizona->pdata.micd_timeout));
}
pm_runtime_mark_last_busy(info->dev);
@@ -1136,7 +1134,7 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
msecs_to_jiffies(HPDET_DEBOUNCE));
if (cancelled_mic) {
- int micd_timeout = info->micd_timeout;
+ int micd_timeout = arizona->pdata.micd_timeout;
queue_delayed_work(system_power_efficient_wq,
&info->micd_timeout_work,
@@ -1213,11 +1211,6 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB);
}
- if (arizona->pdata.micd_timeout)
- info->micd_timeout = arizona->pdata.micd_timeout;
- else
- info->micd_timeout = DEFAULT_MICD_TIMEOUT;
-
out:
/* Clear trig_sts to make sure DCVDD is not forced up */
regmap_write(arizona->regmap, ARIZONA_AOD_WKUP_AND_TRIG,
@@ -1446,6 +1439,9 @@ static int arizona_extcon_probe(struct platform_device *pdev)
info->input->name = "Headset";
info->input->phys = "arizona/extcon";
+ if (!pdata->micd_timeout)
+ pdata->micd_timeout = DEFAULT_MICD_TIMEOUT;
+
if (pdata->num_micd_configs) {
info->micd_modes = pdata->micd_configs;
info->micd_num_modes = pdata->num_micd_configs;
--
2.11.0
next prev parent reply other threads:[~2019-12-09 11:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20191209110925epcas4p3731ec3380f882027824b188439aa3bc9@epcas4p3.samsung.com>
2019-12-09 11:09 ` [PATCH 01/10] extcon: arizona: Correct clean up if arizona_identify_headphone fails Charles Keepax
2019-12-09 11:09 ` [PATCH 02/10] extcon: arizona: Make rev A register sequences atomic Charles Keepax
2019-12-09 11:09 ` Charles Keepax [this message]
2019-12-09 11:09 ` [PATCH 04/10] extcon: arizona: Clear jack status regardless of detection type Charles Keepax
2019-12-09 11:09 ` [PATCH 05/10] extcon: arizona: Tidy up transition from mic to headphone detect Charles Keepax
2019-12-09 11:09 ` [PATCH 06/10] extcon: arizona: Remove unnecessary sets of ACCDET_MODE Charles Keepax
2019-12-09 11:09 ` [PATCH 07/10] extcon: arizona: Remove excessive WARN_ON Charles Keepax
2019-12-09 11:09 ` [PATCH 08/10] extcon: arizona: Invert logic of check in arizona_hpdet_do_id Charles Keepax
2019-12-09 11:09 ` [PATCH 09/10] extcon: arizona: Factor out microphone impedance into a function Charles Keepax
2019-12-09 11:09 ` [PATCH 10/10] extcon: arizona: Factor out microphone and button detection Charles Keepax
2019-12-10 4:47 ` [PATCH 01/10] extcon: arizona: Correct clean up if arizona_identify_headphone fails Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191209110916.29524-3-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).