
On Tuesday 10 March 2015 09:33 PM, Tom Rini wrote:
On Tue, Mar 10, 2015 at 08:41:21PM +0530, Vignesh R wrote:
TI's pcf8575 is a 16-bit I2C based GPIO expander.The device features a 16-bit quasi-bidirectional I/O ports. Each quasi-bidirectional I/O can be used as an input or output without the use of a data-direction control signal. The I/Os should be high before being used as inputs.
This driver is based on pcf857x driver available in Linux 4.0 kernel. It supports basic reading and writing of gpio pins.
For attribution of stuff ported from the kernel please see http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
[snip]
diff --git a/drivers/gpio/pcf8575.c b/drivers/gpio/pcf8575.c new file mode 100644 index 000000000000..1ee92a29760a --- /dev/null +++ b/drivers/gpio/pcf8575.c @@ -0,0 +1,248 @@ +/*
- PCF8575 I2C GPIO EXPANDER DRIVER
- Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation version 2.
- This program is distributed "as is" WITHOUT ANY WARRANTY of any
- kind, whether express or implied; without even the implied warranty
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- */
Please use SPDX tags for new files, thanks.
And right up front, this driver isn't using device model, please re-work and update to use that framework, thanks!
Thanks for reviewing.
I can switch to device model, but DRA72 does not support device tree and hence I will not be able use device model based pcf driver in my use-case.
One approach is that, I will re-write driver to support both deprecated gpio APIs (like gpio_get_value) and gpio device model APIs (dm_gpio_ops). Is this approach okay? But, somebody will have to test the dm_gpio_ops implementations as DRA72 does not support DT.
Regards Vignesh