Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp745806pxp; Fri, 11 Mar 2022 14:02:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjA0WoIytMJde5VCxgpY7CS+d1YvCOMAu6Wj+QrPgasFhRFasyZw4yjicC28cSqjKl4CSN X-Received: by 2002:a65:6093:0:b0:373:9c75:19ec with SMTP id t19-20020a656093000000b003739c7519ecmr10401530pgu.539.1647036160179; Fri, 11 Mar 2022 14:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647036160; cv=none; d=google.com; s=arc-20160816; b=uYKjpNj3VexRTwfoFWP90GC20LNLV6KGMXSuu5ekOUX+3SUKvhObZE9hEVwQ8deuc6 WFz5pm61R3Xyic75v23r2cYKGcPrh00M+9bMYt7eKFTPj/KmERUHjPl6mdD/rAMbNXSt Y+KyZfRxamKceyy5qpIDru8W15amHJDYvMb15D2fLmnCT2f5a79XsJm7pgNhlWh+o1f0 r75c1MSQ268eyUna4vLheR2TA64EYy7tyktNjpFdO45p3USggTIwdNLFjEeEVtfoOJwk ZLQ/eGK9DhGpzrIIyLojOoAqSrwXA/xvLuHEoc11XFia/nZQjKQcxvGwZUM2sQYxKU4K 5JRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=lWnNWcx+SboqtPq9WI7B/BLf7BDyEwBuicgeSMUjIxY=; b=c94tciwTNHUuDP3Ycvb9eNadxIvFaJxyc/d/zzRhUmMcRbOG5ho1xRTHHdN6Pnk4Xl ZMzLTM/yCzsk+ff+7zlEAVrbfeC/2+TBfuRfapsyTIxStHVa7wnCBaEjBeLjmDcXhZbR /ywvcTQ0PTcIgYzpeneK6qeRiGDqR8WgIX6dNtY5ihcYp4L74PDctpw8Ue9Gk3hn0wOl 8ydGJd069tN1XJmg8qVMKN2MfJ3lmOSOEYlbACMQ9Lx7EZU/Z3iLlI849kej1uJRSu8h a+xDVtBn9WH34Q7ANbV5fw8LKrYyyYwMwxVBGmZfu5aSPTYAxNZd9q7lChnzy6mOtu3r BGGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CI2lfgcC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i1-20020a170902cf0100b0014fe2ca91a1si9565811plg.12.2022.03.11.14.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:02:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CI2lfgcC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 799AA20B1A8; Fri, 11 Mar 2022 13:18:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348907AbiCKNa5 (ORCPT + 99 others); Fri, 11 Mar 2022 08:30:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346052AbiCKNa4 (ORCPT ); Fri, 11 Mar 2022 08:30:56 -0500 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7120093188; Fri, 11 Mar 2022 05:29:53 -0800 (PST) Received: by mail-pj1-x1044.google.com with SMTP id cx5so8171168pjb.1; Fri, 11 Mar 2022 05:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=lWnNWcx+SboqtPq9WI7B/BLf7BDyEwBuicgeSMUjIxY=; b=CI2lfgcC0JOTIFvd4yDLT3+LWmWjTs5HWYaKKWWWBU97Q9NR/plDDe0BG3emS2zFKB +PJDSRQC719268FrWzd6QkLdlmk0gVmCBDJok4gCU8MnZ/0SRRUhP0gGlKoebPC+zHzO zOQRl9LlHG6abAWeq3UVrxPIE/ip2pXQRjjjb9O5VwHcZG1FCNZTU/DuAxpPk9S7v2J8 PvnhwSHFwfCvh6aX1eBI5E6w+9QtXlEam++fKNpT6NmS/HpMMKfCg3QngORtBnRb/f2M YLQXFYXmISlNn/Few8+6us2FBav5lVbBA9/3HjYoS9YLk/IVlPUywlRlU9ayBI30Ih/s Yn4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lWnNWcx+SboqtPq9WI7B/BLf7BDyEwBuicgeSMUjIxY=; b=iY6DAJFXeFd2NLcw01C0KA1SxLZIydEu17aNWLq/y237y845glNZH5zsG5AwDsB4Q2 5o8lxiARvPrGai1iCgq6kWEJEwFl2rvefKOg7P/OvS+jSNLhJXMH2wMfUbmGFDSDNP1h YGY17bJZ7Bt29TV6dnzivGzOtN7MfXTRgH87TSztG4im2QIDvr6+DrmwG9XDbAfuudHg HIDA6BSfGxwzIif5DoJ1v4t+R9k1OKbrEzv+kPUnbwgT7J1pCEgBBAKyH5LDVjWNNeLU aOiOGfkogNpQtx0Ch0rB7A3m2nGIAO1pDRQ+G3ftFkWEbBQo83oIGIiLbHF4gxGqONv4 lwbw== X-Gm-Message-State: AOAM5327WYTU6XNR/4mTo5Pj/HuqsKyxrwLcGY4dn7IhJrvUlt2vVuLr MAyIO2fcOZXKpUs/8XmzdT8= X-Received: by 2002:a17:902:b490:b0:14c:da4a:deca with SMTP id y16-20020a170902b49000b0014cda4adecamr10745394plr.134.1647005392946; Fri, 11 Mar 2022 05:29:52 -0800 (PST) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id l17-20020a056a0016d100b004c34686e322sm11319934pfc.182.2022.03.11.05.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 05:29:52 -0800 (PST) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ryans.lee@maximintegrated.com, Steve Lee Subject: [V2 1/2] ASoC: max98390: Add reset gpio control Date: Fri, 11 Mar 2022 22:29:05 +0900 Message-Id: <20220311132906.32292-1-steve.lee.analog@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee --- sound/soc/codecs/max98390.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index b392567c2b3e..5c6162701667 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1022,6 +1022,7 @@ static int max98390_i2c_probe(struct i2c_client *i2c, struct max98390_priv *max98390 = NULL; struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent); + struct gpio_desc *reset_gpio; ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE @@ -1073,6 +1074,17 @@ static int max98390_i2c_probe(struct i2c_client *i2c, return ret; } + reset_gpio = devm_gpiod_get_optional(&i2c->dev, + "maxim,reset-gpios", GPIOD_OUT_LOW); + + /* Power on device */ + if (reset_gpio) { + usleep_range(1000, 2000); + /* bring out of reset */ + gpiod_set_value_cansleep(reset_gpio, 1); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); -- 2.17.1