Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp160307yba; Wed, 3 Apr 2019 06:28:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVigeYmux0lq/yNSYNq9LmM0XKyPb45Zs3DJsdBELw7bJqTOhGj1qe1SpVy+h5dDZBi/FE X-Received: by 2002:a63:ad4b:: with SMTP id y11mr59236522pgo.405.1554298136626; Wed, 03 Apr 2019 06:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554298136; cv=none; d=google.com; s=arc-20160816; b=jjnrNCisHt2YgDOvlNVzLe/hTm9z2PMppbF6zrTIbh2tkvnGOiVh3XMYER5SInvFPV 3YCntAulHJJ1GKAJ+hdSuKPm2tGC1Ax1Qm99KxowDeYm3XYO0IRNC2yd1ENzsEkkatJP V/Sk/9BFU3+4JNavdqrAENm1J1ZvBRvPgEUL6u3jX3VAfHyqb7K+Dqfpaen/VT0oMCmf jo3baIfncscTpcMQbj/FE+eCbJZhz2WKJPvAN4Js7BvmHaVoy/IpwIu7YhZ3fK22chzC lr+Scq2PrS7MhjuvFqcwork5DBNWbQRTHg8Q7CMOykJxk3MIBnkp13bBgYG8uOh2F5GC PRrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=ohvR78HqHu7J9mjobJBEfRMck80T+4Yh9RzRybNl/DM=; b=OOU+UVfCs+zwDyzxW+IIXyIPamX/YyU9enJ2yAzIFPzOGcWYA25hAICHFmKxMTOl1O jzDpF7PlUbsTrg/G69ea+4awVOFvkaz6fOx3ZYZR69JpK5XZKWcRD6WbZYo0t/+3F5rX bSN/D5um/lWcUndLPpfsUs1ML6ap63wyQ8wAJt+oqKnNS/qZG46wu6x1clNFek5SeLCc rZ79txB+NFfqVBUw62hYJ0vdQcVkqqbR0wYKpun6EXZGJ+8IYVpQ+TdhUSBvihVWgCU0 ZFDVbKu8j5GyKpgmLXmSyTVmAo2Zpf4Uc+nU6LO7w2h4dkFwHUdG8nNg1XPiqjw/awwB 8hcg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si12567497pfn.31.2019.04.03.06.28.41; Wed, 03 Apr 2019 06:28:56 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbfDCN0a (ORCPT + 99 others); Wed, 3 Apr 2019 09:26:30 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:55946 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfDCN03 (ORCPT ); Wed, 3 Apr 2019 09:26:29 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x33DL2Uo012281; Wed, 3 Apr 2019 15:23:45 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2rmgmx44j5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 03 Apr 2019 15:23:45 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3B91E34; Wed, 3 Apr 2019 13:23:45 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1E03729C1; Wed, 3 Apr 2019 13:23:45 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 3 Apr 2019 15:23:45 +0200 Received: from localhost (10.201.23.16) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Wed, 3 Apr 2019 15:23:44 +0200 From: Olivier Moysan To: , , , , , , , , , , , , , , , , Subject: [PATCH 3/7] ASoC: cs42l51: add reset management Date: Wed, 3 Apr 2019 15:23:33 +0200 Message-ID: <1554297817-14154-4-git-send-email-olivier.moysan@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554297817-14154-1-git-send-email-olivier.moysan@st.com> References: <1554297817-14154-1-git-send-email-olivier.moysan@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.16] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-03_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Manage cs42l51 audio codec reset pin. Signed-off-by: Olivier Moysan --- sound/soc/codecs/cs42l51.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index f43eb51d2d8d..9b3ffa16b204 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,7 @@ struct cs42l51_private { unsigned int audio_mode; /* The mode (I2S or left-justified) */ enum master_slave_mode func; struct regulator_bulk_data supplies[ARRAY_SIZE(cs42l51_supply_names)]; + struct gpio_desc *reset_gpio; }; #define CS42L51_FORMATS ( \ @@ -595,6 +597,17 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap) return ret; } + cs42l51->reset_gpio = devm_gpiod_get_optional(dev, "reset", + GPIOD_OUT_LOW); + if (IS_ERR(cs42l51->reset_gpio)) + return PTR_ERR(cs42l51->reset_gpio); + + if (cs42l51->reset_gpio) { + dev_dbg(dev, "Release reset gpio\n"); + gpiod_set_value_cansleep(cs42l51->reset_gpio, 0); + mdelay(2); + } + /* Verify that we have a CS42L51 */ ret = regmap_read(regmap, CS42L51_CHIP_REV_ID, &val); if (ret < 0) { @@ -629,6 +642,8 @@ int cs42l51_remove(struct device *dev) { struct cs42l51_private *cs42l51 = dev_get_drvdata(dev); + gpiod_set_value_cansleep(cs42l51->reset_gpio, 1); + return regulator_bulk_disable(ARRAY_SIZE(cs42l51->supplies), cs42l51->supplies); } -- 2.7.4