[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220816130002.41450-3-farbere@amazon.com>
Date: Tue, 16 Aug 2022 13:00:02 +0000
From: Eliav Farber <farbere@...zon.com>
To: <brgl@...ev.pl>, <robh+dt@...nel.org>, <mark.rutland@....com>,
<arnd@...db.de>, <gregkh@...uxfoundation.org>,
<linux-i2c@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <farbere@...zon.com>, <talel@...zon.com>, <hhhawa@...zon.com>,
<jonnyc@...zon.com>, <hanochu@...zon.com>, <ronenk@...zon.com>,
<itamark@...zon.com>, <shellykz@...zon.com>, <shorer@...zon.com>,
<amitlavi@...zon.com>, <almogbs@...zon.com>, <dwmw@...zon.co.uk>
Subject: [PATCH 2/2] eeprom: at24: add enable gpio support
Add gpio support to enable the eeprom device as part of probe sequence.
Signed-off-by: Eliav Farber <farbere@...zon.com>
---
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
Powered by blists - more mailing lists