mbox series

[0/2] add enable gpio support for a24 eeprom driver

Message ID 20220816130002.41450-1-farbere@amazon.com
Headers show
Series add enable gpio support for a24 eeprom driver | expand

Message

Farber, Eliav Aug. 16, 2022, 1 p.m. UTC
First patch describes the new binding property.
Second patch adds the functionality to the driver.

Eliav Farber (2):
  dt-bindings: at24: new optional property - enable-gpios
  eeprom: at24: add enable gpio support

 Documentation/devicetree/bindings/eeprom/at24.txt | 3 +++
 drivers/misc/eeprom/at24.c                        | 5 +++++
 2 files changed, 8 insertions(+)

Comments

Rob Herring (Arm) Aug. 18, 2022, 1:48 a.m. UTC | #1
On Tue, Aug 16, 2022 at 01:00:01PM +0000, Eliav Farber wrote:
> Boards using the AT24 EEPROMs might have a GPIO that must be set to
> enable the chip (e.g. pin that controls the power supply).
> 

If this is a power supply control, use a gpio regulator.

> Add a new optional property to the device tree binding document, which
> allows to specify the GPIO line to which the enable pin is connected.
> 
> On Linux this means that we need to hog the line at the beginning of
> probe function.
> 
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> ---
>  Documentation/devicetree/bindings/eeprom/at24.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
> index f9a7c984274c..553b53ed3e4c 100644
> --- a/Documentation/devicetree/bindings/eeprom/at24.txt
> +++ b/Documentation/devicetree/bindings/eeprom/at24.txt
> @@ -73,6 +73,9 @@ Optional properties:
>  
>    - wp-gpios: GPIO to which the write-protect pin of the chip is connected.
>  
> +  - enable-gpios: GPIO to enables the chip (e.g. pin that controls the eeprom
> +                  power supply).
> +
>    - address-width: number of address bits (one of 8, 16).
>  
>  Example:
> -- 
> 2.37.1
>
Farber, Eliav Aug. 18, 2022, 3:59 p.m. UTC | #2
On 8/18/2022 4:48 AM, Rob Herring wrote:
> If this is a power supply control, use a gpio regulator.

It is indeed a power supply control.
I'll push a new series that uses a gpio regulator.

--
Thanks, Eliav