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 4/4] ASoC: ts3a227e: set irq flag base on dmi
Date: Wed, 29 Apr 2015 18:43:58 -0700	[thread overview]
Message-ID: <1430358238-74659-4-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>

Cyan platform need edge trigger interrupt

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
---
 sound/soc/codecs/ts3a227e.c |   35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 422f66f..75f2a43 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/of_gpio.h>
 #include <linux/regmap.h>
+#include <linux/dmi.h>
 
 #include <sound/core.h>
 #include <sound/jack.h>
@@ -270,6 +271,33 @@ static int ts3a227e_parse_dt(struct ts3a227e *ts3a227e, struct device_node *np)
 	return 0;
 }
 
+static struct ts3a227e_platform_data *ts3a227e_pdata;
+
+static struct ts3a227e_platform_data cyan_platform_data = {
+
+	.irqflag = IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+
+};
+
+static int cyan_quirk_cb(const struct dmi_system_id *id)
+{
+
+	ts3a227e_pdata = &cyan_platform_data;
+
+	return 1;
+}
+
+static struct dmi_system_id dmi_platform_intel_braswell[] = {
+	{
+		.ident = "Braswell Cyan",
+		.callback = cyan_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "Cyan"),
+		},
+	},
+	{ }
+};
+
 static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 			      const struct i2c_device_id *id)
 {
@@ -287,9 +315,12 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 
 	ts3a227e->pdata.irqflag = IRQF_TRIGGER_LOW | IRQF_ONESHOT;
 
-	if (pdata)
+	if (pdata) {
 		ts3a227e->pdata = *pdata;
-
+	} else {
+		if (dmi_check_system(dmi_platform_intel_braswell))
+			ts3a227e->pdata = *ts3a227e_pdata;
+	}
 	ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config);
 	if (IS_ERR(ts3a227e->regmap))
 		return PTR_ERR(ts3a227e->regmap);
-- 
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 ` [PATCH 3/4] ASoC: ts3a227e: add platform data for ts3a227e driver yang.a.fang
2015-04-30 20:02   ` Mark Brown
2015-04-30 20:45     ` Fang, Yang A
2015-04-30 21:25       ` Mark Brown
2015-04-30  1:43 ` yang.a.fang [this message]
2015-04-30 17:45   ` [PATCH 4/4] ASoC: ts3a227e: set irq flag base on dmi 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-4-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).