On 11.4.2016 07:47, Peng Fan wrote:
> On Sat, Apr 09, 2016 at 12:33:34PM -0600, Simon Glass wrote:
>> On 18 March 2016 at 03:54, Peng Fan <[email protected]> wrote:
>>> Introduce a new driver that supports driver model for pca953x.
>>> The pca953x chips are used as I2C I/O expanders.
>>> This driver is designed to support the following chips:
>>> "
>>> 4 bits: pca9536, pca9537
>>> 8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554,
>>> pca9556, pca9557, pca9574, tca6408, xra1202
>>> 16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575,
>>> tca6416
>>> 24 bits: tca6424
>>> 40 bits: pca9505, pca9698
>>> "
>>> But for now this driver only supports max 24 bits and pca953x compatible
>>> chips. pca957x compatible chips are not supported now.
>>> These can be addressed when we need to add such support for the different
>>> chips.
>>> This driver has been tested on i.MX6 SoloX Sabreauto board with max7310
>>> i2c expander using gpio command as following:
>>>
>>> =>gpio status -a
>>> Bank gpio@48:
>>> gpio@480: input: 1 [ ]
>>> => gpio clear gpio@480
>>> gpio: pin gpio@480 (gpio 224) value is 0
>>> => gpio status -a
>>> Bank gpio@48:
>>> gpio@480: output: 0 [ ]
>>
>> Don't you think 480 is confusing? Perhaps you should have gpio@48_ as
>> the bank name? Also I think you should support a gpio-bank-name
>> property in the node, to allow a sensible name to be provided.
>
> 480 is added by gpio uclass driver I think.
> The dts is copied from Linux side. I'd not change the dts, will try to
> see how to introudce a sensible name here.
What's the binding you are using?
The part of this patch should be DT binding.
This is my node.
tca6416_u61: gpio@21 {
compatible = "ti,tca6416";
reg = <0x21>;
gpio-controller;
#gpio-cells = <2>;
};
Thanks,
Michal
ZynqMP> i2c bus
Bus 0: i2c@ff020000
20: gpio@20, offset len 1, flags 0
21: gpio@21, offset len 1, flags 0
75: i2cswitch@75, offset len 1, flags 0
Bus 750: i2c@0
Bus 751: i2c@1
Bus 752: i2c@2
Bus 1: i2c@ff030000
74: i2cswitch@74, offset len 1, flags 0
75: i2cswitch@75, offset len 1, flags 0
Bus 750: i2c@0
Bus 751: i2c@1
Bus 752: i2c@2
Bus 1743: i2c@3
Bus 1744: i2c@4
Bus 750: i2c@0
Bus 751: i2c@1
Bus 752: i2c@2
Bus 1743: i2c@3
Bus 1744: i2c@4
Bus 1755: i2c@5
Bus 1756: i2c@6
Bus 1757: i2c@7
ZynqMP> gpio status -a
__of_translate_address: Bad cell count for gpio@20
Command 'gpio' failed: Error -19
ZynqMP> dm tree
Class Probed Name
----------------------------------------
root [ + ] root_driver
simple_bus [ ] |-- amba_apu
simple_bus [ + ] `-- amba
eth [ + ] |-- ethernet@ff0e0000
i2c [ + ] |-- i2c@ff020000
gpio [ ] | |-- gpio@20
gpio [ ] | |-- gpio@21
i2c_mux [ ] | `-- i2cswitch@75
i2c [ ] | |-- i2c@0
i2c [ ] | |-- i2c@1
i2c [ ] | `-- i2c@2
i2c [ ] |-- i2c@ff030000
i2c_mux [ ] | |-- i2cswitch@74
i2c [ ] | | |-- i2c@0
i2c [ ] | | |-- i2c@1
i2c [ ] | | |-- i2c@2
i2c [ ] | | |-- i2c@3
i2c [ ] | | `-- i2c@4
i2c_mux [ ] | `-- i2cswitch@75
i2c [ ] | |-- i2c@0
i2c [ ] | |-- i2c@1
i2c [ ] | |-- i2c@2
i2c [ ] | |-- i2c@3
i2c [ ] | |-- i2c@4
i2c [ ] | |-- i2c@5
i2c [ ] | |-- i2c@6
i2c [ ] | `-- i2c@7
mmc [ + ] |-- sdhci@ff170000
serial [ + ] |-- serial@ff000000
serial [ ] `-- serial@ff010000
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot