Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp5514548lfu; Mon, 28 Mar 2022 15:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNc7vVimyYoW5NLFf/sRcGZyEnMX5zRQbAHArXy5pc6WGqlL2WrWF5hELovoHslz3t0McR X-Received: by 2002:a05:6808:d46:b0:2ec:f0ff:f8fd with SMTP id w6-20020a0568080d4600b002ecf0fff8fdmr744483oik.231.1648507578693; Mon, 28 Mar 2022 15:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648507578; cv=none; d=google.com; s=arc-20160816; b=MD5cBB+Q1z8sa7ghD3QUZ9o5vuFAK/Bec6FP3DuKNU1d8++RnQnDII7wvwnWNb25DF UEFard2AgzpzvLgnLl3HtbREfCKIMpWgwf34wwb7Fxfr+ljiIysLT/CmT/vNMNkmuDws 5g3gqnNJYJH8xR+d0+v90miHf1A7VfK4utdIZWFR3/oB+Ggq/gvFWPIY63NXC6S3whN5 aMM/Bum+w/c04zL8QU821JsxBLXkzdsouGduThnMipax93fP+XLBZw/+NRBmH5R5/wy1 WjSiUqVYoiP5HfiR26KKyTx6mcPobaBRzDt0cBBP2ZnUeh4MDYGg7QcFZ1yeijQnCTBI oDnw== 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=rUHIWinBLG6g3Xi9+MUcsHpYsUZn1UkahgGOhqUSwAo=; b=d3tqA6lAPhC8NkjfhrmIcZ41lA4QRV0KkPChNeXdRHtSIixEEw/1GQXm1Zpkb7XPxv dtfshvJHhqC23k/JwTb1DEFrxcL+xz1WTSq18N4RtyLS9GatKFkvdU9rCJIq5jVwU1My ypO2/4g2gNdJXByZpT3CYM8p9pf+6on2c15m9snHRgxCicyktlCdypbrdgAJCJNyfRxm VVWxYe8tTR5+GRUAcOIGslG3wdMdydjUXoSQueHt+LsUgKlzxF4Ehv09pqDeEyvOpN4f aoetjhVkFdQG4eMXoHESJRW4Pa0fUtpSMgak4G4oudbfQbEp3bFRA2pZDyFz2kJXnYuj cUsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ByyC85NI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id c132-20020aca358a000000b002ef0c347601si9982520oia.129.2022.03.28.15.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:46:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ByyC85NI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 F29272335FA; Mon, 28 Mar 2022 14:51:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237487AbiC1CNq (ORCPT + 99 others); Sun, 27 Mar 2022 22:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232626AbiC1CNo (ORCPT ); Sun, 27 Mar 2022 22:13:44 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 905904ECD6 for ; Sun, 27 Mar 2022 19:12:05 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id jx9so12653076pjb.5 for ; Sun, 27 Mar 2022 19:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=rUHIWinBLG6g3Xi9+MUcsHpYsUZn1UkahgGOhqUSwAo=; b=ByyC85NIdi1Ve9pqan/WfzM2XYMfuKn3CCtZANGGya2Ss2oL4SZYsyVnf0OEXVxqM+ NlWfBOfMsvpFMBHl8ERRxXmXQtuzccHXUlYyM9m/uRKOMCz6QzS5xAaSboA5lDQTSx2s yt2c+lBVhmyV/cfJpPpmzbZ+WnXCRFdcJbXGrmGyKdiEyIlle0UKaNumtHMKD09ZyvRo ER4DmEYTfjFQdFg2653XMB3h3c9hvLkq1PQhnPmvKj9+lAr9lO/Ptwejnqm9oYLDjgvI H34KW+QREWOLw0hNIHLsV5CUhGPPFHIdlB8xooOeY1/e4UyH39Zh23M1Hn6d9sJWL8np 7Xmg== 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=rUHIWinBLG6g3Xi9+MUcsHpYsUZn1UkahgGOhqUSwAo=; b=a+IxkWe2PP7a9qbV9LIX+S31+oDk30pxTbp5zPYZMR81lxgf7Kq17wMU8+dYhczp/c mQSQKqkYEN8/PPzEyYxEx72uwkn6O22dFSaAvuKHNZgW6UoMZXM6HVjUxcnrQ200KnUD tmriM9tMVuIbpygJTIdRN9QXCjsYIEYq3gZwf/TTo8eYkrhVApPEydPPPanO4UgLZI/k BP2cyvJs4SbPDwPgBn1a3Jzghw95A+PgnxFAwtl74s1TfDChNi7i0E5o3k4JG9vJ3PE9 wKSSt46rnSXGYjr5ZB3CrN9gMf5iIDAv44TtxFCBIUgqMR2XlMBd9HNpPrnF3LEA/BWe aKRQ== X-Gm-Message-State: AOAM532PDp5SDEAKrA/dhtb/c1ezcXppe64r47yPTLCeKZxIso9wmDiy KqwOD8OW+QxQx+A3IyedsXI= X-Received: by 2002:a17:902:9a8d:b0:155:ff17:c9fc with SMTP id w13-20020a1709029a8d00b00155ff17c9fcmr7396091plp.28.1648433525098; Sun, 27 Mar 2022 19:12:05 -0700 (PDT) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id c63-20020a624e42000000b004fa9ee41b7bsm13322058pfb.217.2022.03.27.19.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 19:12:04 -0700 (PDT) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ryans.lee@maximintegrated.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: krzk@kernel.org, nuno.sa@analog.com, Steve Lee Subject: [V3 1/2] ASoC: max98390: Add reset gpio control Date: Mon, 28 Mar 2022 11:11:38 +0900 Message-Id: <20220328021139.8700-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 40fd6f363f35..05df9b85d9b0 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 = i2c->adapter; + 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, + "reset", 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