Hi! > > On Tue 2017-05-09 08:36:12, Cédric Le Goater wrote: > >> The PCA955x family of chips are I2C LED blinkers whose pins not used > >> to control LEDs can be used as general purpose I/Os (GPIOs). > >> > >> The following adds support for device tree and Open Firmware to be > >> able do define different operation modes for each pin. See bindings > >> documentation for more details. The pca955x driver is then extended > >> with a gpio_chip when pins are operating in GPIO mode. > > > > Actually.. maybe better solution would be to turn this into GPIO > > driver, and then use gpio-leds on top...? > > yes probably. We could introduce a new driver for the PCA955[0-3] > when all pins are in GPIO mode. I have taken the approach of the > leds-pca9532 which behaves quite similarly. Does the GPIO mode differ electrically? > > What is the difference between pin in GPIO mode and pin in LED mode? > > Well, first of all the PCA955[0-3] are LED blinkers chips, and not > GPIO chips. So you have an extra couple registers to set the frequency > and the pwm. Well.. PWM is used all over the place, not only for LEDs. > As for the pins in GPIO mode, here is what the specs says : > > - For input, set LEDn to high-impedance (01) and then read the pin > state via the input register. > > - For output, LED output pin is HIGH when the output is programmed > as high-impedance, and LOW when the output is programmed LOW through > the LS register. The output can also be pulse-width controlled when > PWM0 or PWM1 are used. > > So for output, GPIO control is quite similar to LED control. For input, > the INPUTx registers need to be read. Ok, makes sense. So you have GPIO pins with PWM support. (And some kind of blinking? Blinking sounds like a low frequency PWM to me :-). Can you take a look at drivers/pwm? Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Attachment:
signature.asc
Description: Digital signature