Re: [PATCH v2 1/2] video, sm501: add OF binding to support SM501

2011-01-05 Thread Paul Mundt
On Sat, Dec 11, 2010 at 07:31:15AM +0100, Heiko Schocher wrote:
 - add binding to OF, compatible name smi,sm501
 
 - add read/write functions for using this driver
   also on powerpc plattforms
 
 - add commandline options:
   sm501.fb_mode:
 Specify resolution as xresxyres[-bpp][@refresh]
   sm501.bpp:
 Specify bit-per-pixel if not specified mode
 
 - Add support for encoding display mode information
   in the device tree using verbatim EDID block.
 
   If the edid entry in the smi,sm501 node is present,
   the driver will build mode database using EDID data
   and allow setting the display modes from this database.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 cc: linux-fb...@vger.kernel.org
 cc: devicetree-disc...@ozlabs.org
 cc: Ben Dooks b...@simtec.co.uk
 cc: Vincent Sanders vi...@simtec.co.uk
 cc: Samuel Ortiz sa...@linux.intel.com
 cc: linux-ker...@vger.kernel.org
 
 ---
 - changes since v1:
   add Ben Dooks, Vincent Sanders and Samuel Ortiz to cc, as suggested from
   Paul Mundt.
 
  Documentation/kernel-parameters.txt  |7 +
  Documentation/powerpc/dts-bindings/sm501.txt |   30 +++
  drivers/mfd/sm501.c  |  141 --
  drivers/video/sm501fb.c  |  264 
 +-
  include/linux/sm501.h|8 +
  5 files changed, 299 insertions(+), 151 deletions(-)
  create mode 100644 Documentation/powerpc/dts-bindings/sm501.txt
 
So has this stalled out? If Samuel wants to ack the MFD bits I don't mind
taking it through the fbdev tree. I can dust off an SM501 board to make
sure it still works for the non-OF case, although most of the changes
look fairly mechanical, so I don't forsee too much difficulty.

A few minor notes however. For starters, it would be nice to see this
patch split out a bit more logically. All of the items in your changelog
are more or less independent logical changes, and should really be
independent patches. As such, I'd like to see the EDID support as one
patch, the OF binding support layered on top of that, the documentation
split out as a trivial patch, and the I/O routine thing dealt with
separately. This should also make it easier for Samuel to simply ack the
OF bindings part that touch the MFD driver without having to be bothered
with any of the other stuff should regressions pop up at a later point in
time via a bisection.

As far as the DTS bindings documentation goes, I'm not sure what the best
way to split that out is. Perhaps simply lumping it in with the OF
bindings makes the most logical sense, and it's obviously a dependency
for the architecture-specific portion as well.

 @@ -1698,6 +1727,9 @@ static int sm501fb_init_fb(struct fb_info *fb,
   fb-fbops = par-ops;
   fb-flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST |
   FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT |
 +#if defined(CONFIG_PPC_MPC52xx)
 + FBINFO_FOREIGN_ENDIAN |
 +#endif
   FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN;
  
   /* fixed data */

This is now getting in to deep hack territory. It's also not entirely
obvious how you expect things like the imageblit op to work given that
you're not selecting any of FB_{BIG,LITTLE,BOTH,FOREIGN}_ENDIAN, which
leads me to suspect you are manually doing this in your .config in a
relatively fragile way.

In the OF case I suppose you probably want something like:

#ifdef __BIG_ENDIAN
if (of_get_property(dp, little-endian, NULL))
foreign_endian = FBINFO_FOREIGN_ENDIAN;
#else
if (of_get_property(dp, big-endian, NULL))
foreign_endian = FBINFO_FOREIGN_ENDIAN;
#endif

and then simply hide the details in the DTS file in order to get rid of
CPU-specific hacks.

 +#if defined(CONFIG_PPC_MPC52xx)
 +#define smc501_readl(addr)   __do_readl_be((addr))
 +#define smc501_writel(val, addr) __do_writel_be((val), (addr))
 +#else
 +#define smc501_readl(addr)   readl(addr)
 +#define smc501_writel(val, addr) writel(val, addr)
 +#endif

Based on the Kconfig option for endianness you could probably just wrap these
to ioread/write32{,be} and hide the semantics in your iomap implementation?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 1/2] video, sm501: add OF binding to support SM501

2010-12-12 Thread Heiko Schocher
Hello Randy,

Randy Dunlap wrote:
 On Sat, 11 Dec 2010 07:31:15 +0100 Heiko Schocher wrote:
 
 - add commandline options:
   sm501.fb_mode:
 
 sm501.mode:

Sorry, type, should be sm501fb.mode, thanks!

 Specify resolution as xresxyres[-bpp][@refresh]
   sm501.bpp:

Here too, sm501fb.bpp

 Specify bit-per-pixel if not specified mode

 ---

  Documentation/kernel-parameters.txt  |7 +
  Documentation/powerpc/dts-bindings/sm501.txt |   30 +++
  drivers/mfd/sm501.c  |  141 --
  drivers/video/sm501fb.c  |  264 
 +-
  include/linux/sm501.h|8 +
  5 files changed, 299 insertions(+), 151 deletions(-)
  create mode 100644 Documentation/powerpc/dts-bindings/sm501.txt

 diff --git a/Documentation/kernel-parameters.txt 
 b/Documentation/kernel-parameters.txt
 index cdd2a6e..6341541 100644
 --- a/Documentation/kernel-parameters.txt
 +++ b/Documentation/kernel-parameters.txt
 @@ -2301,6 +2301,13 @@ and is between 256 and 4096 characters. It is defined 
 in the file
  merging on their own.
  For more information see Documentation/vm/slub.txt.
  
 +sm501.bpp=  SM501 Display driver:
 +Specify bit-per-pixel if not specified mode
 
   Specifiy bits-per-pixel if not specified by 'mode'
 
 +
 +sm501fb.mode=   SM501 Display driver:
 
 Shouldn't that be sm501.mode ?

No, the name of the source file is sm501fb.c - sm501fb is right here.
As the sm501 is a multifunction device, the fb is more precise here.

 +Specify resolution as
 +xresxyres[-bpp][@refresh]
 +
  smart2= [HW]
  Format: io1[,io2[,...,io8]]
 
 
 However, I think that these shouldn't be added to 
 Documentation/kernel-parameters.txt
 but should be added to the Documentation/fb/ sub-directory either by adding to
 Documentation/fb/modedb.txt or by adding a new file 
 Documentation/fb/sm501.txt.

Ok, do this. Thanks for the review!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 1/2] video, sm501: add OF binding to support SM501

2010-12-11 Thread Randy Dunlap
On Sat, 11 Dec 2010 07:31:15 +0100 Heiko Schocher wrote:

 - add commandline options:
   sm501.fb_mode:

sm501.mode:

 Specify resolution as xresxyres[-bpp][@refresh]
   sm501.bpp:
 Specify bit-per-pixel if not specified mode
 
 ---
 
  Documentation/kernel-parameters.txt  |7 +
  Documentation/powerpc/dts-bindings/sm501.txt |   30 +++
  drivers/mfd/sm501.c  |  141 --
  drivers/video/sm501fb.c  |  264 
 +-
  include/linux/sm501.h|8 +
  5 files changed, 299 insertions(+), 151 deletions(-)
  create mode 100644 Documentation/powerpc/dts-bindings/sm501.txt
 
 diff --git a/Documentation/kernel-parameters.txt 
 b/Documentation/kernel-parameters.txt
 index cdd2a6e..6341541 100644
 --- a/Documentation/kernel-parameters.txt
 +++ b/Documentation/kernel-parameters.txt
 @@ -2301,6 +2301,13 @@ and is between 256 and 4096 characters. It is defined 
 in the file
   merging on their own.
   For more information see Documentation/vm/slub.txt.
  
 + sm501.bpp=  SM501 Display driver:
 + Specify bit-per-pixel if not specified mode

Specifiy bits-per-pixel if not specified by 'mode'

 +
 + sm501fb.mode=   SM501 Display driver:
 + Specify resolution as
 + xresxyres[-bpp][@refresh]
 +
   smart2= [HW]
   Format: io1[,io2[,...,io8]]


However, I think that these shouldn't be added to 
Documentation/kernel-parameters.txt
but should be added to the Documentation/fb/ sub-directory either by adding to
Documentation/fb/modedb.txt or by adding a new file Documentation/fb/sm501.txt.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 1/2] video, sm501: add OF binding to support SM501

2010-12-11 Thread Randy Dunlap
On Sat, 11 Dec 2010 07:31:15 +0100 Heiko Schocher wrote:

 - add commandline options:
   sm501.fb_mode:

sm501.mode:

 Specify resolution as xresxyres[-bpp][@refresh]
   sm501.bpp:
 Specify bit-per-pixel if not specified mode
 
 ---
 
  Documentation/kernel-parameters.txt  |7 +
  Documentation/powerpc/dts-bindings/sm501.txt |   30 +++
  drivers/mfd/sm501.c  |  141 --
  drivers/video/sm501fb.c  |  264 
 +-
  include/linux/sm501.h|8 +
  5 files changed, 299 insertions(+), 151 deletions(-)
  create mode 100644 Documentation/powerpc/dts-bindings/sm501.txt
 
 diff --git a/Documentation/kernel-parameters.txt 
 b/Documentation/kernel-parameters.txt
 index cdd2a6e..6341541 100644
 --- a/Documentation/kernel-parameters.txt
 +++ b/Documentation/kernel-parameters.txt
 @@ -2301,6 +2301,13 @@ and is between 256 and 4096 characters. It is defined 
 in the file
   merging on their own.
   For more information see Documentation/vm/slub.txt.
  
 + sm501.bpp=  SM501 Display driver:
 + Specify bit-per-pixel if not specified mode

Specifiy bits-per-pixel if not specified by 'mode'

 +
 + sm501fb.mode=   SM501 Display driver:

Shouldn't that be sm501.mode ?

 + Specify resolution as
 + xresxyres[-bpp][@refresh]
 +
   smart2= [HW]
   Format: io1[,io2[,...,io8]]


However, I think that these shouldn't be added to 
Documentation/kernel-parameters.txt
but should be added to the Documentation/fb/ sub-directory either by adding to
Documentation/fb/modedb.txt or by adding a new file Documentation/fb/sm501.txt.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev