[alsa-devel] [PATCH 4/4] ASoC: ts3a227e: set irq flag base on dmi
yang.a.fang at intel.com
yang.a.fang at intel.com
Thu Apr 30 03:43:58 CEST 2015
From: "Fang, Yang A" <yang.a.fang at intel.com>
Cyan platform need edge trigger interrupt
Signed-off-by: Fang, Yang A <yang.a.fang at 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
More information about the Alsa-devel
mailing list