Re: [PATCH v2 1/2] rtc: ds1302: add register access abstraction layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mon, 2016-06-27 at 20:19 +0900, Akinobu Mita wrote:
> The rtc-ds1302 driver now implemented using SPI 3wire mode.
> But I would like to access it with using three wires connected to
> GPIO
> lines.
> 
> This adds abstraction layer for DS1302 register access in order to
> prepare to support for using GPIO lines.  This enables to share
> common
> code between SPI driver and GPIO driver.

I don't think this is the right way. DS-1302 is an SPI device, not a
GPIO one. It can be connected to a hardware SPI controller or a
software one (on top of GPIO or memory).

Your patch re-adds Microwire SPI control logic to RTC subsystem, which
was cleared by my rewrite of drivers/rtc/rtc-ds1302.c. The logic is
already present in bitbang_txrx_be_cpha0_lsb() in drivers/spi/spi-
lp8841-rtc.c.

I still think you need to implement spi-gpio-3wire with LSB-first
support in SPI subsystem instead. It wasn't done when I was adding
LP8841 support, because LP8841 was the only use case of Microwire SPI
control logic. If you add it, drivers/spi/spi-lp8841-rtc.c can be
removed and replaced by a GPIO driver to host a new spi-gpio-3wire
device.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux