From patchwork Mon Jan 5 11:26:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-yi Chiang X-Patchwork-Id: 5566811 Return-Path: X-Original-To: patchwork-linux-arm@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 10AC69F4DC for ; Mon, 5 Jan 2015 11:29:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29B3A20154 for ; Mon, 5 Jan 2015 11:29:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E4632014A for ; Mon, 5 Jan 2015 11:29:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y85oy-0002C5-JZ; Mon, 05 Jan 2015 11:27:40 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y85oq-0001tR-QR for linux-arm-kernel@lists.infradead.org; Mon, 05 Jan 2015 11:27:33 +0000 Received: by mail-pa0-f44.google.com with SMTP id et14so28524877pad.31 for ; Mon, 05 Jan 2015 03:27:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=D4Cm5xzDy3A7pQBC1kTIutpKYjPrEVw4ydQ2oiR/zCY=; b=TVpNc+RzT4plS3sBiR5CcV+ydJfl+PDBHZw/IwpA0JVfOyaMdYgMQm2hDfpCpd4NC2 zZ/7oZRQGDGVvUblo4fSoYDt82d51buggKy8LAgBJxKTEZqzoHPXFlvlNdJGPc9y4kWW KCKN/o6WuoV6dWksJNEWHqwwWOtGyGvg9iRG8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=D4Cm5xzDy3A7pQBC1kTIutpKYjPrEVw4ydQ2oiR/zCY=; b=CXoCcRvV5dqTRxrh+mSUfVXqfNSbcX4wTU1MVh20BiPy9SztEjQWkPtM16JB+zG9vR GITHVOEi48MRGa3uzVX14W2KAbFcte9qX3uw86/Dm+xD4iftftGGBLowY2jfX0Fpcil2 WT3AiTjqtZREMNyeTNvoUPLoWDAQ/x3MGfK+4nKAWbs1Ikmz0xouG5YTsEqy4QRyj2NS W6TNHkWv1WTupOYxTMmaxhRrCo0Jyp5U/5oe91dXWEZn/Ten+1kC40bkyoincY3pvE42 cpKnlWUuN9F3y+TP3uzL7PY0dgKrMvECWRoWTF4xIKCt5LVnbjPElLseWCXEO8ryilef 7ayQ== X-Gm-Message-State: ALoCoQnu7Tq6n8XhdjmXFyhD3ZfokWtm/Ef2DG4YVW2msu7MgeIYioujfRuaVnit/Nt7foiPigBF X-Received: by 10.68.134.164 with SMTP id pl4mr143511270pbb.128.1420457230781; Mon, 05 Jan 2015 03:27:10 -0800 (PST) Received: from cychiang.tpe.corp.google.com ([172.30.210.40]) by mx.google.com with ESMTPSA id c2sm21759823pdi.25.2015.01.05.03.27.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jan 2015 03:27:09 -0800 (PST) From: Cheng-Yi Chiang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ASoC: ts3a227e: Check and report jack status at probe Date: Mon, 5 Jan 2015 19:26:59 +0800 Message-Id: <1420457219-23098-1-git-send-email-cychiang@chromium.org> X-Mailer: git-send-email 2.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150105_032732_918002_16F11E35 X-CRM114-Status: UNSURE ( 8.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: alsa-devel@alsa-project.org, Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , Jaroslav Kysela , Mark Brown , Dylan Reid , Cheng-Yi Chiang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ts3a227e does not trigger interrupt to report jack status when system boots from warm reset because ts3a227e's power remains on during warm reset. Read jack status at probe to get current jack status. Note that if system boots from EC reset, then this issue will not happen. Signed-off-by: Cheng-Yi Chiang --- sound/soc/codecs/ts3a227e.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c index 1d12057..9f2dced 100644 --- a/sound/soc/codecs/ts3a227e.c +++ b/sound/soc/codecs/ts3a227e.c @@ -254,6 +254,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c, struct ts3a227e *ts3a227e; struct device *dev = &i2c->dev; int ret; + unsigned int acc_reg; ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL); if (ts3a227e == NULL) @@ -283,6 +284,11 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c, INTB_DISABLE | ADC_COMPLETE_INT_DISABLE, ADC_COMPLETE_INT_DISABLE); + /* Read jack status because chip might not trigger interrupt at boot. */ + regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg); + ts3a227e_new_jack_state(ts3a227e, acc_reg); + ts3a227e_jack_report(ts3a227e); + return 0; }