Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3628776rwb; Tue, 16 Aug 2022 06:25:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR4taQ2WZLJkvaA3EAhWH0xz6fwH24dM6vVwq12upaV51n2PJPGc1wuGU9nUzyxNhRFcuDCR X-Received: by 2002:a17:907:7245:b0:732:f72f:44e3 with SMTP id ds5-20020a170907724500b00732f72f44e3mr12929065ejc.503.1660656330708; Tue, 16 Aug 2022 06:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660656330; cv=none; d=google.com; s=arc-20160816; b=AsDxebO/XuSsK4ZhDI/zaETA9mG+MvcK/1rkFA2DuFAryH37kRYZsvGb5jna7ERT6k iOM/GQHSxgQySHK/Bdflj24BCL3CbTuQjqEZHU+H4Gs8gqQNnVWklt4/s41h2hO8+5XI WOiNfnczyoIE3OhqmARrx9CE7tq0yLZ695fZnnRMN5tc3KvOubPDHHRPQPkbWGoMpe5W MSUs4m4Xl49WX2QJ8oDORgSjNpCAJmxNvoeqlJDiw3P6IZtzlWTZs2Ahhpl+xy27GKNk 5RMBVWcNZXKYqxHrzr0DpZAi+TW4i89xOIalcCjhFOdJwDDsCGUK2ufJO1xXgOqCKtgD zEpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OMRMQgwvgYeKotw1UaJE5PsArWxM8zmGn3KgUNZ1AW8=; b=wjWBMpOfnvxHeQbjZrARa0i1NnMFEVwWrzseaVhxcuXGBbyZF2wVfXXrTQsSuGbRIH CQXxMOt1FELs9i1k5pgAcvu+CTaGyiJ3O4lIQtZyOIM91wg6gKI5xIQu12pBEK1/LgWs N39jBDB4+j5n+KBIDvB0Vc4jVQNwnmIuYxHcBUydcLZXBKV1aEJNEMEDTuLT9SmttO5G 6ZCo405Fidz1aRx37vxM+O3klr+uq10L4r7ek+ZW0VlXX2P2xfHABDeyQvuOICLu6gcz ZzCy2s2nvxqEXJXsp+Hyo309MGSu93q2G9jnzDhVt8hz5WqVrFc1/ZSKLnPC+0xCPfsZ YeDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ccDZiMJk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g39-20020a056402322700b00445b64fb69dsi123496eda.212.2022.08.16.06.25.05; Tue, 16 Aug 2022 06:25:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ccDZiMJk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235261AbiHPNCh (ORCPT + 99 others); Tue, 16 Aug 2022 09:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235303AbiHPNAx (ORCPT ); Tue, 16 Aug 2022 09:00:53 -0400 Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F29D286C06; Tue, 16 Aug 2022 06:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1660654825; x=1692190825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OMRMQgwvgYeKotw1UaJE5PsArWxM8zmGn3KgUNZ1AW8=; b=ccDZiMJkaNv8+nonaWcXcZNvXxA37orQyHztYH9es780fzGKUHh9AIt0 cSBcvAKNkQ4oyiB7RUuk1Oe1vaFlhkNMyeC+tKK1aWpQBcHQ2TctXkYOS YzfuAq/N/gQXau4HkqqBRIg8jCG57nqgk981lFkL9uUuiw0Lp/t32uhwp I=; X-IronPort-AV: E=Sophos;i="5.93,241,1654560000"; d="scan'208";a="230216051" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-4ba5c7da.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 13:00:14 +0000 Received: from EX13MTAUEE002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1a-4ba5c7da.us-east-1.amazon.com (Postfix) with ESMTPS id E12C23002EE; Tue, 16 Aug 2022 13:00:11 +0000 (UTC) Received: from EX13D08UEE001.ant.amazon.com (10.43.62.126) by EX13MTAUEE002.ant.amazon.com (10.43.62.24) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Tue, 16 Aug 2022 13:00:06 +0000 Received: from EX13MTAUEE002.ant.amazon.com (10.43.62.24) by EX13D08UEE001.ant.amazon.com (10.43.62.126) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Tue, 16 Aug 2022 13:00:04 +0000 Received: from dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (172.19.116.181) by mail-relay.amazon.com (10.43.62.224) with Microsoft SMTP Server id 15.0.1497.38 via Frontend Transport; Tue, 16 Aug 2022 13:00:03 +0000 Received: by dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (Postfix, from userid 14301484) id 480FC5AA; Tue, 16 Aug 2022 13:00:02 +0000 (UTC) From: Eliav Farber To: , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 2/2] eeprom: at24: add enable gpio support Date: Tue, 16 Aug 2022 13:00:02 +0000 Message-ID: <20220816130002.41450-3-farbere@amazon.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220816130002.41450-1-farbere@amazon.com> References: <20220816130002.41450-1-farbere@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_SPF_WL autolearn=ham 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 gpio support to enable the eeprom device as part of probe sequence. Signed-off-by: Eliav Farber --- drivers/misc/eeprom/at24.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index dc3537651b80..06535b9e1da5 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -623,6 +623,7 @@ static int at24_probe(struct i2c_client *client) struct device *dev = &client->dev; bool i2c_fn_i2c, i2c_fn_block; unsigned int i, num_addresses; + struct gpio_desc *enable_gpio; struct at24_data *at24; struct regmap *regmap; size_t at24_size; @@ -630,6 +631,10 @@ static int at24_probe(struct i2c_client *client) u8 test_byte; int err; + enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH); + if (IS_ERR(enable_gpio)) + return PTR_ERR(enable_gpio); + i2c_fn_i2c = i2c_check_functionality(client->adapter, I2C_FUNC_I2C); i2c_fn_block = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_I2C_BLOCK); -- 2.37.1