Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11445666ybi; Thu, 25 Jul 2019 16:44:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqz94v5pTC7tFdLFTvwwZ4TzgW7utcJ471gPr9W6XGa452MYA6d5lRb5xELjZe4tVGvaasPy X-Received: by 2002:a65:60d3:: with SMTP id r19mr63375725pgv.91.1564098297567; Thu, 25 Jul 2019 16:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564098297; cv=none; d=google.com; s=arc-20160816; b=cOPsAstp0g/6WIxeO/RiwUJlcrvjKWR8M1orR9WsLMLByAOKAfUF/LpsT91HaaTKUw XGxVOSjXlq2ccE4KfiXWs+OQB5/Pagc3B2sUDdcRwWs9mPNJ3SQO4zSbixn75PAHE2T1 k0fRTZnf2eAopHLKaG6v/06161w1bJcvudELI92KOpT077pOiK4Wj69AkIcuVtRw6vmr lFlrh3TqzQkLFfeqs92rLoedtWF38qVwpOepWZDwLO/FW+b9GANHo0ksOILCDWYY256O PCAPTgqh6ZFJIcbSvtVXNZNc9JMdaq2oqrpUL810B05NTnvtYh5DJBOOu2j+UA3Omo06 STyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0QgT2MRsWNC4Fv+0vRe9Pt0Wkcb/SapDMhPBU8AwiDI=; b=aGBc0b6NmoyH05nppeblT5F1aQFnMG8Zfn3PNcPtRJWhrftU5HOV8weraCCJPLh3Lx ZTznhiKBsaT7Mny9oYCMCCM6n+69EDz2A+rssUfQCTj1y+vJeOaWyMhG86qGsX3mjwfw ZgyIC4zFJjUx/adIN4XT2vF8U/wkF3xoxuYWjUzzVrcqB/6qUZ6GLTCMkarb2kevnuh5 52lXk/EL3Bww5CZqcApLD+zn/Ug+TOeLExjzhkT4QvRVHPI5Ok8KkIuz/D0UZKWLgRa4 /ja2ubwJj/PVV8GjXHITgQ5WcHZL8hbd27npyowoJGV5T0wmpWNpOXx5HtxWzWJF2uPv BvxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r190si17717551pfr.102.2019.07.25.16.44.43; Thu, 25 Jul 2019 16:44:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727278AbfGYXlT (ORCPT + 99 others); Thu, 25 Jul 2019 19:41:19 -0400 Received: from mga06.intel.com ([134.134.136.31]:51808 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbfGYXlS (ORCPT ); Thu, 25 Jul 2019 19:41:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 16:41:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="369874688" Received: from amrutaku-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.255.230.75]) by fmsmga006.fm.intel.com with ESMTP; 25 Jul 2019 16:41:16 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Pierre-Louis Bossart , Bard Liao , Sanyog Kale Subject: [RFC PATCH 12/40] soundwire: cadence_master: revisit interrupt settings Date: Thu, 25 Jul 2019 18:40:04 -0500 Message-Id: <20190725234032.21152-13-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding missing interrupt masks (parity, etc) and missing checks. Clarify which masks are for which usage. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index bdc3ed844829..0f3b9c160b01 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -76,9 +76,12 @@ #define CDNS_MCP_INT_DPINT BIT(11) #define CDNS_MCP_INT_CTRL_CLASH BIT(10) #define CDNS_MCP_INT_DATA_CLASH BIT(9) +#define CDNS_MCP_INT_PARITY BIT(8) #define CDNS_MCP_INT_CMD_ERR BIT(7) +#define CDNS_MCP_INT_RX_NE BIT(3) #define CDNS_MCP_INT_RX_WL BIT(2) #define CDNS_MCP_INT_TXE BIT(1) +#define CDNS_MCP_INT_TXF BIT(0) #define CDNS_MCP_INTSET 0x4C @@ -689,6 +692,11 @@ irqreturn_t sdw_cdns_irq(int irq, void *dev_id) } } + if (int_status & CDNS_MCP_INT_PARITY) { + /* Parity error detected by Master */ + dev_err_ratelimited(cdns->dev, "Parity error\n"); + } + if (int_status & CDNS_MCP_INT_CTRL_CLASH) { /* Slave is driving bit slot during control word */ dev_err_ratelimited(cdns->dev, "Bus clash for control word\n"); @@ -761,10 +769,21 @@ int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns) cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK1, CDNS_MCP_SLAVE_INTMASK1_MASK); + /* enable detection of slave state changes */ mask = CDNS_MCP_INT_SLAVE_RSVD | CDNS_MCP_INT_SLAVE_ALERT | - CDNS_MCP_INT_SLAVE_ATTACH | CDNS_MCP_INT_SLAVE_NATTACH | - CDNS_MCP_INT_CTRL_CLASH | CDNS_MCP_INT_DATA_CLASH | - CDNS_MCP_INT_RX_WL | CDNS_MCP_INT_IRQ | CDNS_MCP_INT_DPINT; + CDNS_MCP_INT_SLAVE_ATTACH | CDNS_MCP_INT_SLAVE_NATTACH; + + /* enable detection of bus issues */ + mask |= CDNS_MCP_INT_CTRL_CLASH | CDNS_MCP_INT_DATA_CLASH | + CDNS_MCP_INT_PARITY; + + /* no detection of port interrupts for now */ + + /* enable detection of RX fifo level */ + mask |= CDNS_MCP_INT_RX_WL; + + /* now enable all of the above */ + mask |= CDNS_MCP_INT_IRQ; cdns_writel(cdns, CDNS_MCP_INTMASK, mask); -- 2.20.1