alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: yang.a.fang@intel.com
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: alsa-devel@alsa-project.org, vinod.koul@intel.com,
	praveen.k.jain@intel.com, praveen.diwakar@intel.com,
	denny.iriawan@intel.com, "Fang, Yang A" <yang.a.fang@intel.com>,
	kevin.strasser@linux.intel.com, dgreid@chromium.org
Subject: [PATCH 3/4] ASoC: ts3a227e: add platform data for ts3a227e driver
Date: Wed, 29 Apr 2015 18:43:57 -0700	[thread overview]
Message-ID: <1430358238-74659-3-git-send-email-yang.a.fang@intel.com> (raw)
In-Reply-To: <1430358238-74659-1-git-send-email-yang.a.fang@intel.com>

From: "Fang, Yang A" <yang.a.fang@intel.com>

make irq flag part of platform data

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
---
 include/sound/ts3a227e.h    |   19 +++++++++++++++++++
 sound/soc/codecs/ts3a227e.c |    9 ++++++++-
 sound/soc/codecs/ts3a227e.h |    2 ++
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 include/sound/ts3a227e.h

diff --git a/include/sound/ts3a227e.h b/include/sound/ts3a227e.h
new file mode 100644
index 0000000..c005084
--- /dev/null
+++ b/include/sound/ts3a227e.h
@@ -0,0 +1,19 @@
+/*
+ * Platform data for TS3A227E
+ *
+ * Copyright (C) 2015 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_SND_TS3A227E_H
+#define __LINUX_SND_TS3A227E_H
+
+struct ts3a227e_platform_data {
+
+	unsigned long irqflag;
+};
+
+#endif
diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 9fd80ac..422f66f 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -25,6 +25,7 @@
 struct ts3a227e {
 	struct regmap *regmap;
 	struct snd_soc_jack *jack;
+	struct ts3a227e_platform_data pdata;
 	bool plugged;
 	bool mic_present;
 	unsigned int buttons_held;
@@ -274,6 +275,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 {
 	struct ts3a227e *ts3a227e;
 	struct device *dev = &i2c->dev;
+	struct ts3a227e_platform_data *pdata = dev_get_platdata(&i2c->dev);
 	int ret;
 	unsigned int acc_reg;
 
@@ -283,6 +285,11 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 
 	i2c_set_clientdata(i2c, ts3a227e);
 
+	ts3a227e->pdata.irqflag = IRQF_TRIGGER_LOW | IRQF_ONESHOT;
+
+	if (pdata)
+		ts3a227e->pdata = *pdata;
+
 	ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config);
 	if (IS_ERR(ts3a227e->regmap))
 		return PTR_ERR(ts3a227e->regmap);
@@ -296,7 +303,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 	}
 
 	ret = devm_request_threaded_irq(dev, i2c->irq, NULL, ts3a227e_interrupt,
-					IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+					ts3a227e->pdata.irqflag,
 					"TS3A227E", ts3a227e);
 	if (ret) {
 		dev_err(dev, "Cannot request irq %d (%d)\n", i2c->irq, ret);
diff --git a/sound/soc/codecs/ts3a227e.h b/sound/soc/codecs/ts3a227e.h
index e2acf9c..a587a72 100644
--- a/sound/soc/codecs/ts3a227e.h
+++ b/sound/soc/codecs/ts3a227e.h
@@ -11,6 +11,8 @@
 #ifndef _TS3A227E_H
 #define _TS3A227E_H
 
+#include <sound/ts3a227e.h>
+
 int ts3a227e_enable_jack_detect(struct snd_soc_component *component,
 				struct snd_soc_jack *jack);
 
-- 
1.7.9.5

  parent reply	other threads:[~2015-04-30  1:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30  1:43 [PATCH 1/4] ASoC: Intel: Add support max98090 in sst driver yang.a.fang
2015-04-30  1:43 ` [PATCH 2/4] ASoC: Intel: Add Cherrytrail & Braswell machine driver cht_bsw_max98090 yang.a.fang
2015-04-30  4:36   ` Vinod Koul
2015-04-30  6:24     ` Yang Fang
2015-04-30 15:40       ` Pierre-Louis Bossart
2015-04-30 16:39         ` Dylan Reid
2015-04-30 18:30           ` Pierre-Louis Bossart
2015-04-30 17:43         ` Fang, Yang A
2015-05-01  4:44       ` Vinod Koul
2015-04-30 20:15   ` Mark Brown
2015-04-30 20:19   ` Mark Brown
2015-05-01 18:42   ` [PATCH v2 1/2] ASoC: Intel: Add support max98090 in sst driver yang.a.fang
2015-05-01 18:42     ` [PATCH v2 2/2] ASoC: Intel: Add Cherrytrail & Braswell machine driver cht_bsw_max98090_ti yang.a.fang
2015-05-04 12:17       ` Mark Brown
2015-05-04 14:40         ` Fang, Yang A
2015-05-04 17:14           ` Mark Brown
2015-05-04 12:16     ` [PATCH v2 1/2] ASoC: Intel: Add support max98090 in sst driver Mark Brown
2015-04-30  1:43 ` yang.a.fang [this message]
2015-04-30 20:02   ` [PATCH 3/4] ASoC: ts3a227e: add platform data for ts3a227e driver Mark Brown
2015-04-30 20:45     ` Fang, Yang A
2015-04-30 21:25       ` Mark Brown
2015-04-30  1:43 ` [PATCH 4/4] ASoC: ts3a227e: set irq flag base on dmi yang.a.fang
2015-04-30 17:45   ` Dylan Reid
2015-04-30 20:08     ` Mark Brown

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=1430358238-74659-3-git-send-email-yang.a.fang@intel.com \
    --to=yang.a.fang@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=denny.iriawan@intel.com \
    --cc=dgreid@chromium.org \
    --cc=kevin.strasser@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=praveen.diwakar@intel.com \
    --cc=praveen.k.jain@intel.com \
    --cc=vinod.koul@intel.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).