Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2020-01-20 Thread Sam Ravnborg
Hi Geert.

> > It is on my TODO list to make a mipi-dbi driver that in the future
> > replaces the auxdisplay driver for hd44780.
> 
> Please note that hd44780 is a character controller.
Directory was correct - but name was wrong.
It is cfag12864b I have on my TODO.

And yes, the code for hd44780 is similar. The name was familiar
because I also looked at this driver back then.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2020-01-20 Thread Geert Uytterhoeven
Hi Sam,

On Mon, Jan 20, 2020 at 7:48 PM Sam Ravnborg  wrote:
> On Mon, Jan 20, 2020 at 11:10:37AM +0100, Geert Uytterhoeven wrote:
> > On Thu, Aug 2, 2018 at 9:46 PM Sam Ravnborg  wrote:
> > > The pardata supports implement a simple bus for devices
> > > that are connected using a parallel bus driven by GPIOs.
> > > The is often used in combination with simple displays
> > > that is often seen in older embedded designs.
> > > There is a demand for this support also in the linux
> > > kernel for HW designs that uses these kind of displays.
> > >
> > > The pardata bus uses a platfrom_driver that when probed
> > > creates devices for all child nodes in the DT,
> > > which are then supposed to be handled by pardata_drivers.
> > >
> > > Signed-off-by: Sam Ravnborg 
> >
> > > --- /dev/null
> > > +++ b/Documentation/driver-api/pardata.rst
> > > @@ -0,0 +1,60 @@
> > > +.. SPDX-License-Identifier: GPL-2.0
> > > +
> > > +=
> > > +Parallel Data Bus/Drivers
> > > +=
> > > +
> > > +Displays may be connected using a simple parallel bus.
> > > +This is often seen in embedded systems with a simple MCU, but is also
> > > +used in Linux based systems to a small extent.
> > > +
> > > +The bus looks like this:
> > > +
> > > +.. code-block:: none
> > > +
> > > +   +
> > > +   |  DB0-DB7 or DB4-DB7  +
> > > +   ===/
> > > +   |  E - enable  |  D
> > > +     I
> > > +C  |  Reset   |  S
> > > +P    P
> > > +U  |  Read/Write (one or two) |  L
> > > +     A
> > > +   |  RS - instruction/data   |  Y
> > > +   
> > > +   |  +
> > > +   +
> >
> > Oh, cool!  Looks like this can be used by the hd44780 driver.
> >
> > Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt
> > drivers/auxdisplay/hd44780.c
>
> This patchset was from a time when I knew next to nothing about DRM.
> Now I am just confused on a different level :-)

The more you know, the more you realize what you don't know ;-)

> It is on my TODO list to make a mipi-dbi driver that in the future
> replaces the auxdisplay driver for hd44780.

Please note that hd44780 is a character controller.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2020-01-20 Thread Sam Ravnborg
Hi Geert.

On Mon, Jan 20, 2020 at 11:10:37AM +0100, Geert Uytterhoeven wrote:
> Hi Sam,
> 
> (stumbled on this accidentally)
> 
> On Thu, Aug 2, 2018 at 9:46 PM Sam Ravnborg  wrote:
> > The pardata supports implement a simple bus for devices
> > that are connected using a parallel bus driven by GPIOs.
> > The is often used in combination with simple displays
> > that is often seen in older embedded designs.
> > There is a demand for this support also in the linux
> > kernel for HW designs that uses these kind of displays.
> >
> > The pardata bus uses a platfrom_driver that when probed
> > creates devices for all child nodes in the DT,
> > which are then supposed to be handled by pardata_drivers.
> >
> > Signed-off-by: Sam Ravnborg 
> 
> > --- /dev/null
> > +++ b/Documentation/driver-api/pardata.rst
> > @@ -0,0 +1,60 @@
> > +.. SPDX-License-Identifier: GPL-2.0
> > +
> > +=
> > +Parallel Data Bus/Drivers
> > +=
> > +
> > +Displays may be connected using a simple parallel bus.
> > +This is often seen in embedded systems with a simple MCU, but is also
> > +used in Linux based systems to a small extent.
> > +
> > +The bus looks like this:
> > +
> > +.. code-block:: none
> > +
> > +   +
> > +   |  DB0-DB7 or DB4-DB7  +
> > +   ===/
> > +   |  E - enable  |  D
> > +     I
> > +C  |  Reset   |  S
> > +P    P
> > +U  |  Read/Write (one or two) |  L
> > +     A
> > +   |  RS - instruction/data   |  Y
> > +   
> > +   |  +
> > +   +
> 
> Oh, cool!  Looks like this can be used by the hd44780 driver.
> 
> Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt
> drivers/auxdisplay/hd44780.c

This patchset was from a time when I knew next to nothing about DRM.
Now I am just confused on a different level :-)

It is on my TODO list to make a mipi-dbi driver that in the future
replaces the auxdisplay driver for hd44780.
But that TODO list have a growing tendency.
It seems that pretending to be co-maintainer on panel/ stuff
alone can take up most of my DRM time.

I hope Paul will contribute the i8080 support to drm_mipi_dbi,
at least he mentioned he planned to work on this.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2020-01-20 Thread Geert Uytterhoeven
Hi Sam,

(stumbled on this accidentally)

On Thu, Aug 2, 2018 at 9:46 PM Sam Ravnborg  wrote:
> The pardata supports implement a simple bus for devices
> that are connected using a parallel bus driven by GPIOs.
> The is often used in combination with simple displays
> that is often seen in older embedded designs.
> There is a demand for this support also in the linux
> kernel for HW designs that uses these kind of displays.
>
> The pardata bus uses a platfrom_driver that when probed
> creates devices for all child nodes in the DT,
> which are then supposed to be handled by pardata_drivers.
>
> Signed-off-by: Sam Ravnborg 

> --- /dev/null
> +++ b/Documentation/driver-api/pardata.rst
> @@ -0,0 +1,60 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +=
> +Parallel Data Bus/Drivers
> +=
> +
> +Displays may be connected using a simple parallel bus.
> +This is often seen in embedded systems with a simple MCU, but is also
> +used in Linux based systems to a small extent.
> +
> +The bus looks like this:
> +
> +.. code-block:: none
> +
> +   +
> +   |  DB0-DB7 or DB4-DB7  +
> +   ===/
> +   |  E - enable  |  D
> +     I
> +C  |  Reset   |  S
> +P    P
> +U  |  Read/Write (one or two) |  L
> +     A
> +   |  RS - instruction/data   |  Y
> +   
> +   |  +
> +   +

Oh, cool!  Looks like this can be used by the hd44780 driver.

Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt
drivers/auxdisplay/hd44780.c

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2018-08-11 Thread Sam Ravnborg
Hi Noralf.

On Tue, Aug 07, 2018 at 06:40:29PM +0200, Noralf Trønnes wrote:
> Hi Sam,
> 
> Den 02.08.2018 21.45, skrev Sam Ravnborg:
> >The pardata supports implement a simple bus for devices
> >that are connected using a parallel bus driven by GPIOs.
> >The is often used in combination with simple displays
> >that is often seen in older embedded designs.
> >There is a demand for this support also in the linux
> >kernel for HW designs that uses these kind of displays.
> >
> >The pardata bus uses a platfrom_driver that when probed
> >creates devices for all child nodes in the DT,
> >which are then supposed to be handled by pardata_drivers.
> >
> >Signed-off-by: Sam Ravnborg 
> >---
> 
> From a quick look at this I have these comments:
> 1. There can only be one implementation of this bus, the gpio one.
>    There are SOC's with parallel bus hardware so you need to allow for
>    more implementations.
> 2. The client shouldn't do the bus signaling. This should be hidden
>    behind read and write functions in pardata.
> 3. I would also suggest you add an address bus instead of the RS pin
> 4. I don't think reset belongs in the bus. It's a device thing.

Excellent feedback - I will address this in v2.

> 5. You can use gpiod_set_array_value() in the gpio implementation.
>    Some gpio drivers can set all gpios at once.

Yes, it is already used. But only for DB0 to DB7 as there
are timing constraings for the others.

> 
> I made an attempt at implementing a bus like this a while back:
> https://github.com/notro/fbdbi/tree/master/i80

Thanks, very helpfull.

v2 will take a while as I plan to have something that actually works
before posting next version.

One open question. Miguel Ojeda mentioned that there is already a
limited fbdev driver made on top of parport (part of auxdisplay).
Is it the correct design to come up with a new bus or should this
try to build on top of parport?

I did not check in details if using parport is possible, but from a
quick look it is doable.
But then we use parport for something that it originally was not
designed for and we drag with us a lot of extra functionality.
So I like the slimmer pardata bus.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2018-08-08 Thread Noralf Trønnes


Den 08.08.2018 10.24, skrev Sam Ravnborg:

Hi Noralf.

On Tue, Aug 07, 2018 at 06:40:29PM +0200, Noralf Trønnes wrote:

Hi Sam,

Den 02.08.2018 21.45, skrev Sam Ravnborg:

The pardata supports implement a simple bus for devices
that are connected using a parallel bus driven by GPIOs.
The is often used in combination with simple displays
that is often seen in older embedded designs.
There is a demand for this support also in the linux
kernel for HW designs that uses these kind of displays.

The pardata bus uses a platfrom_driver that when probed
creates devices for all child nodes in the DT,
which are then supposed to be handled by pardata_drivers.

Signed-off-by: Sam Ravnborg 
---

 From a quick look at this I have these comments:
1. There can only be one implementation of this bus, the gpio one.
    There are SOC's with parallel bus hardware so you need to allow for
    more implementations.
2. The client shouldn't do the bus signaling. This should be hidden
    behind read and write functions in pardata.
3. I would also suggest you add an address bus instead of the RS pin
4. I don't think reset belongs in the bus. It's a device thing.

Excellent feedback - I will address this in v2.


5. You can use gpiod_set_array_value() in the gpio implementation.
    Some gpio drivers can set all gpios at once.

Yes, it is already used. But only for DB0 to DB7 as there
are timing constraings for the others.


I made an attempt at implementing a bus like this a while back:
https://github.com/notro/fbdbi/tree/master/i80

Thanks, very helpfull.

v2 will take a while as I plan to have something that actually works
before posting next version.

One open question. Miguel Ojeda mentioned that there is already a
limited fbdev driver made on top of parport (part of auxdisplay).
Is it the correct design to come up with a new bus or should this
try to build on top of parport?

I did not check in details if using parport is possible, but from a
quick look it is doable.
But then we use parport for something that it originally was not
designed for and we drag with us a lot of extra functionality.
So I like the slimmer pardata bus.


I couldn't find a parport gpio driver, so you would have to write one by
the looks of it.

I think it would be best to add a new bus type, but that's just my opinion.
I suggest you study the other bus types (spi, i2c, spmi) to get an
understanding of how it's done.

Noralf.

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/5] pardata: new bus for parallel data access

2018-08-07 Thread Noralf Trønnes

Hi Sam,

Den 02.08.2018 21.45, skrev Sam Ravnborg:

The pardata supports implement a simple bus for devices
that are connected using a parallel bus driven by GPIOs.
The is often used in combination with simple displays
that is often seen in older embedded designs.
There is a demand for this support also in the linux
kernel for HW designs that uses these kind of displays.

The pardata bus uses a platfrom_driver that when probed
creates devices for all child nodes in the DT,
which are then supposed to be handled by pardata_drivers.

Signed-off-by: Sam Ravnborg 
---


From a quick look at this I have these comments:
1. There can only be one implementation of this bus, the gpio one.
   There are SOC's with parallel bus hardware so you need to allow for
   more implementations.
2. The client shouldn't do the bus signaling. This should be hidden
   behind read and write functions in pardata.
3. I would also suggest you add an address bus instead of the RS pin
4. I don't think reset belongs in the bus. It's a device thing.
5. You can use gpiod_set_array_value() in the gpio implementation.
   Some gpio drivers can set all gpios at once.

I made an attempt at implementing a bus like this a while back:
https://github.com/notro/fbdbi/tree/master/i80

Noralf.


  Documentation/driver-api/index.rst   |   1 +
  Documentation/driver-api/pardata.rst |  60 
  MAINTAINERS  |   9 ++
  drivers/Kconfig  |   2 +
  drivers/Makefile |   1 +
  drivers/pardata/Kconfig  |  17 +++
  drivers/pardata/Makefile |   5 +
  drivers/pardata/pardata.c| 282 +++
  include/linux/pardata.h  | 138 +
  9 files changed, 515 insertions(+)
  create mode 100644 Documentation/driver-api/pardata.rst
  create mode 100644 drivers/pardata/Kconfig
  create mode 100644 drivers/pardata/Makefile
  create mode 100644 drivers/pardata/pardata.c
  create mode 100644 include/linux/pardata.h

diff --git a/Documentation/driver-api/index.rst 
b/Documentation/driver-api/index.rst
index 6d9f2f9fe20e..1808fca406ae 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -41,6 +41,7 @@ available subsections can be seen below.
 miscellaneous
 w1
 rapidio
+   pardata
 s390-drivers
 vme
 80211/index
diff --git a/Documentation/driver-api/pardata.rst 
b/Documentation/driver-api/pardata.rst
new file mode 100644
index ..a811f024a0fe
--- /dev/null
+++ b/Documentation/driver-api/pardata.rst
@@ -0,0 +1,60 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=
+Parallel Data Bus/Drivers
+=
+
+Displays may be connected using a simple parallel bus.
+This is often seen in embedded systems with a simple MCU, but is also
+used in Linux based systems to a small extent.
+
+The bus looks like this:
+
+.. code-block:: none
+
+   +
+   |  DB0-DB7 or DB4-DB7  +
+   ===/
+   |  E - enable  |  D
+     I
+C  |  Reset   |  S
+P    P
+U  |  Read/Write (one or two) |  L
+     A
+   |  RS - instruction/data   |  Y
+   
+   |  +
+   +
+
+There may be several devices connected to the bus with individual
+reset and read/write signals.
+Two types of interfaces are supported. 8800 with a single read/write signal,
+and 6800 with individual read/write signals.
+
+Display supported by the parallel data bus: 
``_
+
+The overall code structure is
+
+.. code-block:: none
+
+  platform_device [pardata bus]   <--- pardatabus [driver]
+   |
+   +-> device
+ |
+ +-> pardata_bus_data
+
+  pardata_device
+  |
+  +-> device
+|
++->
+
+  pardatabus_bus
+
+
+API documentation
+=
+.. kernel-doc:: include/linux/pardata.h
+   :internal:
+.. kernel-doc:: drivers/pardata/pardata.c
+   :internal:
diff --git a/MAINTAINERS b/MAINTAINERS
index 96e98e206b0d..4ba7ff7c3e46 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10727,6 +10727,15 @@ L: platform-driver-...@vger.kernel.org
  S:Maintained
  F:drivers/platform/x86/panasonic-laptop.c
  
+PARALLEL DATA SUBSYSTEM

+M: Sam Ravnborg 
+S: Maintained
+F: drivers/pardata/
+F: include/linux/pardata.h
+F: drivers/gpu/drm/tinydrm/pardata-dbi.c
+F: include/drm/pardata-dbi.h
+F: Documentation/driver-api/pardata.rst
+
  PARALLEL LCD/KEYPAD PANEL DRIVER
  M:Willy Tarreau 
  M:Ksenija Stanojevic 
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 95b9ccc08165..b51b25aae9a5 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -217,4 +217,6 @@ source "drivers/