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: 5566801 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 870D39F4DC for ; Mon, 5 Jan 2015 11:29:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4C502015A for ; Mon, 5 Jan 2015 11:29:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 278892014A for ; Mon, 5 Jan 2015 11:29:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4666B2650FF; Mon, 5 Jan 2015 12:29:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM, RCVD_IN_SBL, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8BC7D265066; Mon, 5 Jan 2015 12:28:28 +0100 (CET) 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 3EDD82605C8; Mon, 5 Jan 2015 12:28:26 +0100 (CET) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by alsa0.perex.cz (Postfix) with ESMTP id DD44726510A for ; Mon, 5 Jan 2015 12:27:11 +0100 (CET) Received: by mail-pd0-f178.google.com with SMTP id r10so27972027pdi.37 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=I2SfdAVeMsv+m9aRpsvgddjkceEkoMws8ByQsUcZHVaD38+D+9VKITzr70xDWebdvi synPmANxXSn9MlceyaJcobf0rNf8fcdS+zSgctei2R33TVeJ4fCFQl5GFuJfvjE1jVC7 oyCW13h4NVGtylFzuuBR+7wGn9n9Ag961cnQ0jFG+rwTRycXVCnicG+evLM6yznB6Mv3 ZPITsh5dwefKMsnfNw2ayaAT1XyFIqEZHPAjfOUAEAa+JSF2ZYyDm6b+gnkODSlcCDf1 L/j8zmC4uWzSfDTGC9o8WOlk9n9YAIopBgyiD6kbYo3Mm3KvaMGGVZLcU9i+ITtuvk0a zkJQ== X-Gm-Message-State: ALoCoQkdSWzVrw8RCBTpPJQnsGuCZfIwHPqd8uy9rH3CtjJ5LXTxhbdfVDh5OLwvjiGg07I/7NA4 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 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 Cc: alsa-devel@alsa-project.org, Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , Dylan Reid , Cheng-Yi Chiang Subject: [alsa-devel] [PATCH] ASoC: ts3a227e: Check and report jack status at probe 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 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; }