From patchwork Thu Apr 30 01:43:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yang.a.fang@intel.com X-Patchwork-Id: 6299531 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 70B849F1C2 for ; Thu, 30 Apr 2015 01:45:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 916F72017D for ; Thu, 30 Apr 2015 01:45:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5D67A2015A for ; Thu, 30 Apr 2015 01:45:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 813DD2659ED; Thu, 30 Apr 2015 03:45:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6F69C261484; Thu, 30 Apr 2015 03:44:55 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 873CD2608CD; Thu, 30 Apr 2015 03:44:51 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 5DDC42608EC for ; Thu, 30 Apr 2015 03:44:42 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 29 Apr 2015 18:44:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,674,1422950400"; d="scan'208";a="564023270" Received: from mocha.sc.intel.com ([143.183.245.87]) by orsmga003.jf.intel.com with ESMTP; 29 Apr 2015 18:44:41 -0700 From: yang.a.fang@intel.com To: broonie@kernel.org, lgirdwood@gmail.com Date: Wed, 29 Apr 2015 18:43:58 -0700 Message-Id: <1430358238-74659-4-git-send-email-yang.a.fang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1430358238-74659-1-git-send-email-yang.a.fang@intel.com> References: <1430358238-74659-1-git-send-email-yang.a.fang@intel.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" , kevin.strasser@linux.intel.com, dgreid@chromium.org Subject: [alsa-devel] [PATCH 4/4] ASoC: ts3a227e: set irq flag base on dmi X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Fang, Yang A" Cyan platform need edge trigger interrupt Signed-off-by: Fang, Yang A --- 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 #include #include +#include #include #include @@ -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);