Re: [PATCH v4] misc: Move panel driver out of staging

2016-02-03 Thread Ksenija Stanojević
On Wed, Feb 3, 2016 at 10:19 AM, Joe Perches  wrote:
> On Wed, 2016-02-03 at 08:15 +0100, Ksenija Stanojevic wrote:
>> Move panel driver from drivers/staging/panel to drivers/misc.
> []
>> diff --git a/MAINTAINERS b/MAINTAINERS
> []
>> @@ -10393,8 +10393,10 @@ F:   drivers/staging/nvec/
>>
>>  STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
>
> Apologies for not noticing this before.
>
> Please remove the "STAGING - " from the section name
> and relocate the entire section to the appropriate
> place alphabetically in the MAINTAINER file.

It's my fault for not noticing, I'll fix it and resend patch.

Thanks,
Ksenija
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v5] misc: Move panel driver out of staging

2016-02-03 Thread Ksenija Stanojevic
Move panel driver from drivers/staging/panel to drivers/misc.

Signed-off-by: Ksenija Stanojevic 
Acked-by: Willy Tarreau 
---
Changes in v5:
- relocate the entire section to the appropriate place alphabetically
in the MAINTAINER file.

Changes in v4:
- modify driver location in MAINTAINERS file

Changes in v3:
- modify driver location in MAINTAINERS file

Changes in v2:
- modify MAINTAINERS file
- move lcd-panel-cgram.txt to Documentation/


 .../misc-devices}/lcd-panel-cgram.txt  |   0
 MAINTAINERS|  12 +-
 drivers/misc/Kconfig   | 278 +
 drivers/misc/Makefile  |   1 +
 drivers/{staging/panel => misc}/panel.c|   0
 drivers/staging/Kconfig|   2 -
 drivers/staging/Makefile   |   1 -
 drivers/staging/panel/Kconfig  | 278 -
 drivers/staging/panel/Makefile |   1 -
 drivers/staging/panel/TODO |   8 -
 10 files changed, 286 insertions(+), 295 deletions(-)
 rename {drivers/staging/panel => 
Documentation/misc-devices}/lcd-panel-cgram.txt (100%)
 rename drivers/{staging/panel => misc}/panel.c (100%)
 delete mode 100644 drivers/staging/panel/Kconfig
 delete mode 100644 drivers/staging/panel/Makefile
 delete mode 100644 drivers/staging/panel/TODO

diff --git a/drivers/staging/panel/lcd-panel-cgram.txt 
b/Documentation/misc-devices/lcd-panel-cgram.txt
similarity index 100%
rename from drivers/staging/panel/lcd-panel-cgram.txt
rename to Documentation/misc-devices/lcd-panel-cgram.txt
diff --git a/MAINTAINERS b/MAINTAINERS
index 369f6ae..7c39a48 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8168,6 +8168,13 @@ S:   Maintained
 F: Documentation/mn10300/
 F: arch/mn10300/
 
+PARALLEL LCD/KEYPAD PANEL DRIVER
+M:  Willy Tarreau 
+M:  Ksenija Stanojevic 
+S:  Odd Fixes
+F:  Documentation/misc-devices/lcd-panel-cgram.txt
+F:  drivers/misc/panel.c
+
 PARALLEL PORT SUBSYSTEM
 M: Sudip Mukherjee 
 M: Sudip Mukherjee 
@@ -10391,11 +10398,6 @@ L: linux-te...@vger.kernel.org
 S: Maintained
 F: drivers/staging/nvec/
 
-STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
-M: Willy Tarreau 
-S: Odd Fixes
-F: drivers/staging/panel/
-
 STAGING - REALTEK RTL8712U DRIVERS
 M: Larry Finger 
 M: Florian Schilhabel .
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 054fc10..f0ba782 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -525,6 +525,284 @@ config VEXPRESS_SYSCFG
  ARM Ltd. Versatile Express uses specialised platform configuration
  bus. System Configuration interface is one of the possible means
  of generating transactions on this bus.
+config PANEL
+   tristate "Parallel port LCD/Keypad Panel support"
+   depends on PARPORT
+   ---help---
+ Say Y here if you have an HD44780 or KS-0074 LCD connected to your
+ parallel port. This driver also features 4 and 6-key keypads. The LCD
+ is accessible through the /dev/lcd char device (10, 156), and the
+ keypad through /dev/keypad (10, 185). Both require misc device to be
+ enabled. This code can either be compiled as a module, or linked into
+ the kernel and started at boot. If you don't understand what all this
+ is about, say N.
+
+config PANEL_PARPORT
+   int "Default parallel port number (0=LPT1)"
+   depends on PANEL
+   range 0 255
+   default "0"
+   ---help---
+ This is the index of the parallel port the panel is connected to. One
+ driver instance only supports one parallel port, so if your keypad
+ and LCD are connected to two separate ports, you have to start two
+ modules with different arguments. Numbering starts with '0' for LPT1,
+ and so on.
+
+config PANEL_PROFILE
+   int "Default panel profile (0-5, 0=custom)"
+   depends on PANEL
+   range 0 5
+   default "5"
+   ---help---
+ To ease configuration, the driver supports different configuration
+ profiles for past and recent wirings. These profiles can also be
+ used to define an approximative configuration, completed by a few
+ other options. Here are the profiles :
+
+   0 = custom (see further)
+   1 = 2x16 parallel LCD, old keypad
+   2 = 2x16 serial LCD (KS-0074), new keypad
+   3 = 2x16 parallel LCD (Hantronix), no keypad
+   4 = 2x16 parallel LCD (Nexcom NSA1045) with Nexcom's keypad
+   5 = 2x40 parallel LCD (old one), with old keypad
+

Re: [PATCH v4] misc: Move panel driver out of staging

2016-02-03 Thread Joe Perches
On Wed, 2016-02-03 at 08:15 +0100, Ksenija Stanojevic wrote:
> Move panel driver from drivers/staging/panel to drivers/misc.
[]
> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -10393,8 +10393,10 @@ F:   drivers/staging/nvec/
>  
>  STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER

Apologies for not noticing this before.

Please remove the "STAGING - " from the section name
and relocate the entire section to the appropriate
place alphabetically in the MAINTAINER file.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojevic
Move panel driver from drivers/staging/panel to drivers/misc.

Signed-off-by: Ksenija Stanojevic 
---
Changes in v2:
- modify MAINTAINERS file
- move lcd-panel-cgram.txt to Documentation/

 .../misc-devices}/lcd-panel-cgram.txt  |   1 -
 MAINTAINERS|   1 +
 drivers/misc/Kconfig   | 278 +
 drivers/misc/Makefile  |   1 +
 drivers/{staging/panel => misc}/panel.c|   0
 drivers/staging/Kconfig|   2 -
 drivers/staging/Makefile   |   1 -
 drivers/staging/panel/Kconfig  | 278 -
 drivers/staging/panel/Makefile |   1 -
 drivers/staging/panel/TODO |   8 -
 10 files changed, 280 insertions(+), 291 deletions(-)
 rename {drivers/staging/panel => 
Documentation/misc-devices}/lcd-panel-cgram.txt (99%)
 rename drivers/{staging/panel => misc}/panel.c (100%)
 delete mode 100644 drivers/staging/panel/Kconfig
 delete mode 100644 drivers/staging/panel/Makefile
 delete mode 100644 drivers/staging/panel/TODO

diff --git a/drivers/staging/panel/lcd-panel-cgram.txt 
b/Documentation/misc-devices/lcd-panel-cgram.txt
similarity index 99%
rename from drivers/staging/panel/lcd-panel-cgram.txt
rename to Documentation/misc-devices/lcd-panel-cgram.txt
index 7f82c90..32171f8 100644
--- a/drivers/staging/panel/lcd-panel-cgram.txt
+++ b/Documentation/misc-devices/lcd-panel-cgram.txt
@@ -21,4 +21,3 @@ examples :
   printf "\e[LG2061E1E060200;"  => small speaker
 
 Willy
-
diff --git a/MAINTAINERS b/MAINTAINERS
index 369f6ae..91c529a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10393,6 +10393,7 @@ F:  drivers/staging/nvec/
 
 STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
 M: Willy Tarreau 
+M: Ksenija Stanojevic 
 S: Odd Fixes
 F: drivers/staging/panel/
 
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 054fc10..f0ba782 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -525,6 +525,284 @@ config VEXPRESS_SYSCFG
  ARM Ltd. Versatile Express uses specialised platform configuration
  bus. System Configuration interface is one of the possible means
  of generating transactions on this bus.
+config PANEL
+   tristate "Parallel port LCD/Keypad Panel support"
+   depends on PARPORT
+   ---help---
+ Say Y here if you have an HD44780 or KS-0074 LCD connected to your
+ parallel port. This driver also features 4 and 6-key keypads. The LCD
+ is accessible through the /dev/lcd char device (10, 156), and the
+ keypad through /dev/keypad (10, 185). Both require misc device to be
+ enabled. This code can either be compiled as a module, or linked into
+ the kernel and started at boot. If you don't understand what all this
+ is about, say N.
+
+config PANEL_PARPORT
+   int "Default parallel port number (0=LPT1)"
+   depends on PANEL
+   range 0 255
+   default "0"
+   ---help---
+ This is the index of the parallel port the panel is connected to. One
+ driver instance only supports one parallel port, so if your keypad
+ and LCD are connected to two separate ports, you have to start two
+ modules with different arguments. Numbering starts with '0' for LPT1,
+ and so on.
+
+config PANEL_PROFILE
+   int "Default panel profile (0-5, 0=custom)"
+   depends on PANEL
+   range 0 5
+   default "5"
+   ---help---
+ To ease configuration, the driver supports different configuration
+ profiles for past and recent wirings. These profiles can also be
+ used to define an approximative configuration, completed by a few
+ other options. Here are the profiles :
+
+   0 = custom (see further)
+   1 = 2x16 parallel LCD, old keypad
+   2 = 2x16 serial LCD (KS-0074), new keypad
+   3 = 2x16 parallel LCD (Hantronix), no keypad
+   4 = 2x16 parallel LCD (Nexcom NSA1045) with Nexcom's keypad
+   5 = 2x40 parallel LCD (old one), with old keypad
+
+ Custom configurations allow you to define how your display is
+ wired to the parallel port, and how it works. This is only intended
+ for experts.
+
+config PANEL_KEYPAD
+   depends on PANEL && PANEL_PROFILE="0"
+   int "Keypad type (0=none, 1=old 6 keys, 2=new 6 keys, 3=Nexcom 4 keys)"
+   range 0 3
+   default 0
+   ---help---
+ This enables and configures a keypad connected to the parallel port.
+ The keys will be read from character device 10,185. Valid values are :
+
+   0 : do not enable this driver
+   1 : old 6 keys keypad
+   2 : new 6 keys keypad, as used on the server at 

Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojević
On Tue, Feb 2, 2016 at 6:44 PM, Greg KH  wrote:
> On Tue, Feb 02, 2016 at 06:19:43PM +0100, Ksenija Stanojević wrote:
>> On Tue, Feb 2, 2016 at 6:14 PM, Greg KH  wrote:
>> > On Tue, Feb 02, 2016 at 05:48:56PM +0100, Ksenija Stanojević wrote:
>> >> Hi Greg,
>> >>
>> >> On Tue, Feb 2, 2016 at 5:23 PM, Greg KH  
>> >> wrote:
>> >> > On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
>> >> >> Move panel driver from drivers/staging/panel to drivers/misc.
>> >> >>
>> >> >> Signed-off-by: Ksenija Stanojevic 
>> >> >> ---
>> >> >>  drivers/misc/Kconfig  |  278 
>> >> >>  drivers/misc/Makefile |1 +
>> >> >>  drivers/misc/panel.c  | 2445 
>> >> >> +
>> >> >>  drivers/staging/Kconfig   |2 -
>> >> >>  drivers/staging/Makefile  |1 -
>> >> >>  drivers/staging/panel/Kconfig |  278 
>> >> >>  drivers/staging/panel/Makefile|1 -
>> >> >>  drivers/staging/panel/TODO|8 -
>> >> >>  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
>> >> >>  drivers/staging/panel/panel.c | 2445 
>> >> >> -
>> >> >>  10 files changed, 2724 insertions(+), 2759 deletions(-)
>> >> >>  create mode 100644 drivers/misc/panel.c
>> >> >>  delete mode 100644 drivers/staging/panel/Kconfig
>> >> >>  delete mode 100644 drivers/staging/panel/Makefile
>> >> >>  delete mode 100644 drivers/staging/panel/TODO
>> >> >>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
>> >> >>  delete mode 100644 drivers/staging/panel/panel.c
>> >> >
>> >> >
>> >> > Can you generate a patch like this with the -M option to git
>> >> > format-patch?
>> >>
>> >> I tried that but it didn't change anything.
>> >
>> > It worked for me:
>> >
>> >  drivers/misc/Kconfig  | 278 
>> > ++
>> >  drivers/misc/Makefile |   1 +
>> >  drivers/{staging/panel => misc}/panel.c   |   0
>> >  drivers/staging/Kconfig   |   2 -
>> >  drivers/staging/Makefile  |   1 -
>> >  drivers/staging/panel/Kconfig | 278 
>> > --
>> >  drivers/staging/panel/Makefile|   1 -
>> >  drivers/staging/panel/TODO|   8 -
>> >  drivers/staging/panel/lcd-panel-cgram.txt |  24 ---
>> >  9 files changed, 279 insertions(+), 314 deletions(-)
>> >  rename drivers/{staging/panel => misc}/panel.c (100%)
>> >  delete mode 100644 drivers/staging/panel/Kconfig
>> >  delete mode 100644 drivers/staging/panel/Makefile
>> >  delete mode 100644 drivers/staging/panel/TODO
>> >  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
>> >
>> > See the lines that show the file being renamed?
>> >
>> > How exactly did you export the patch?
>>
>> git fomat-patch HEAD^ -M
>
> I just tried that as well, and got the same result I posted above.

i use git sen-email HEAD^ instead *.patch, now it works.

Thanks,
Ksenija
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] misc: Move panel driver out of staging

2016-02-02 Thread Joe Perches
On Tue, 2016-02-02 at 19:12 +0100, Ksenija Stanojevic wrote:
> Move panel driver from drivers/staging/panel to drivers/misc.
[]
> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -10393,6 +10393,7 @@ F:drivers/staging/nvec/
>  
>  STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
>  M:   Willy Tarreau 
> +M:   Ksenija Stanojevic 
>  S:   Odd Fixes
>  F:   drivers/staging/panel/

While it's good you add yourself as a maintainer,
the F: pattern should be updated to reflect the
new driver location.


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojević
On Tue, Feb 2, 2016 at 7:24 PM, Joe Perches  wrote:
> On Tue, 2016-02-02 at 19:12 +0100, Ksenija Stanojevic wrote:
>> Move panel driver from drivers/staging/panel to drivers/misc.
> []
>> diff --git a/MAINTAINERS b/MAINTAINERS
> []
>> @@ -10393,6 +10393,7 @@ F:drivers/staging/nvec/
>>
>>  STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
>>  M:   Willy Tarreau 
>> +M:   Ksenija Stanojevic 
>>  S:   Odd Fixes
>>  F:   drivers/staging/panel/
>
> While it's good you add yourself as a maintainer,
> the F: pattern should be updated to reflect the
> new driver location.

oops i'll fix that
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojevic
Move panel driver from drivers/staging/panel to drivers/misc.

Signed-off-by: Ksenija Stanojevic 
---
Changes in v3:
- modify driver location in MAINTAINERS file

Changes in v2:
- modify MAINTAINERS file
- move lcd-panel-cgram.txt to Documentation/

 .../misc-devices}/lcd-panel-cgram.txt  |   0
 MAINTAINERS|   3 +-
 drivers/misc/Kconfig   | 278 +
 drivers/misc/Makefile  |   1 +
 drivers/{staging/panel => misc}/panel.c|   0
 drivers/staging/Kconfig|   2 -
 drivers/staging/Makefile   |   1 -
 drivers/staging/panel/Kconfig  | 278 -
 drivers/staging/panel/Makefile |   1 -
 drivers/staging/panel/TODO |   8 -
 10 files changed, 281 insertions(+), 291 deletions(-)
 rename {drivers/staging/panel => 
Documentation/misc-devices}/lcd-panel-cgram.txt (100%)
 rename drivers/{staging/panel => misc}/panel.c (100%)
 delete mode 100644 drivers/staging/panel/Kconfig
 delete mode 100644 drivers/staging/panel/Makefile
 delete mode 100644 drivers/staging/panel/TODO

diff --git a/drivers/staging/panel/lcd-panel-cgram.txt 
b/Documentation/misc-devices/lcd-panel-cgram.txt
similarity index 100%
rename from drivers/staging/panel/lcd-panel-cgram.txt
rename to Documentation/misc-devices/lcd-panel-cgram.txt
diff --git a/MAINTAINERS b/MAINTAINERS
index 369f6ae..7731ad6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10393,8 +10393,9 @@ F:  drivers/staging/nvec/
 
 STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
 M: Willy Tarreau 
+M: Ksenija Stanojevic 
 S: Odd Fixes
-F: drivers/staging/panel/
+F: drivers/misc/
 
 STAGING - REALTEK RTL8712U DRIVERS
 M: Larry Finger 
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 054fc10..f0ba782 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -525,6 +525,284 @@ config VEXPRESS_SYSCFG
  ARM Ltd. Versatile Express uses specialised platform configuration
  bus. System Configuration interface is one of the possible means
  of generating transactions on this bus.
+config PANEL
+   tristate "Parallel port LCD/Keypad Panel support"
+   depends on PARPORT
+   ---help---
+ Say Y here if you have an HD44780 or KS-0074 LCD connected to your
+ parallel port. This driver also features 4 and 6-key keypads. The LCD
+ is accessible through the /dev/lcd char device (10, 156), and the
+ keypad through /dev/keypad (10, 185). Both require misc device to be
+ enabled. This code can either be compiled as a module, or linked into
+ the kernel and started at boot. If you don't understand what all this
+ is about, say N.
+
+config PANEL_PARPORT
+   int "Default parallel port number (0=LPT1)"
+   depends on PANEL
+   range 0 255
+   default "0"
+   ---help---
+ This is the index of the parallel port the panel is connected to. One
+ driver instance only supports one parallel port, so if your keypad
+ and LCD are connected to two separate ports, you have to start two
+ modules with different arguments. Numbering starts with '0' for LPT1,
+ and so on.
+
+config PANEL_PROFILE
+   int "Default panel profile (0-5, 0=custom)"
+   depends on PANEL
+   range 0 5
+   default "5"
+   ---help---
+ To ease configuration, the driver supports different configuration
+ profiles for past and recent wirings. These profiles can also be
+ used to define an approximative configuration, completed by a few
+ other options. Here are the profiles :
+
+   0 = custom (see further)
+   1 = 2x16 parallel LCD, old keypad
+   2 = 2x16 serial LCD (KS-0074), new keypad
+   3 = 2x16 parallel LCD (Hantronix), no keypad
+   4 = 2x16 parallel LCD (Nexcom NSA1045) with Nexcom's keypad
+   5 = 2x40 parallel LCD (old one), with old keypad
+
+ Custom configurations allow you to define how your display is
+ wired to the parallel port, and how it works. This is only intended
+ for experts.
+
+config PANEL_KEYPAD
+   depends on PANEL && PANEL_PROFILE="0"
+   int "Keypad type (0=none, 1=old 6 keys, 2=new 6 keys, 3=Nexcom 4 keys)"
+   range 0 3
+   default 0
+   ---help---
+ This enables and configures a keypad connected to the parallel port.
+ The keys will be read from character device 10,185. Valid values are :
+
+   0 : do not enable this driver
+   1 : old 6 keys keypad
+   2 : new 6 keys keypad, as used on the server at 
www.ant-computing.com
+   3 : Nexcom NSA1045's 4 keys 

Re: [PATCH v3] misc: Move panel driver out of staging

2016-02-02 Thread Greg KH
On Tue, Feb 02, 2016 at 07:39:02PM +0100, Ksenija Stanojevic wrote:
> Move panel driver from drivers/staging/panel to drivers/misc.
> 
> Signed-off-by: Ksenija Stanojevic 
> ---
> Changes in v3:
>   - modify driver location in MAINTAINERS file
> 
> Changes in v2:
> - modify MAINTAINERS file
> - move lcd-panel-cgram.txt to Documentation/

I'd like to get an ack from Willy about this patch as well, before I can
accept it.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] misc: Move panel driver out of staging

2016-02-02 Thread Willy Tarreau
On Tue, Feb 02, 2016 at 12:59:50PM -0800, Greg KH wrote:
> On Tue, Feb 02, 2016 at 07:39:02PM +0100, Ksenija Stanojevic wrote:
> > Move panel driver from drivers/staging/panel to drivers/misc.
> > 
> > Signed-off-by: Ksenija Stanojevic 
> > ---
> > Changes in v3:
> > - modify driver location in MAINTAINERS file
> > 
> > Changes in v2:
> > - modify MAINTAINERS file
> > - move lcd-panel-cgram.txt to Documentation/
> 
> I'd like to get an ack from Willy about this patch as well, before I can
> accept it.

Sorry for the delay, still trying to catch up with my e-mails.

Acked-by: Willy Tarreau 
 
Thanks,
willy

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] misc: Move panel driver out of staging

2016-02-02 Thread Joe Perches
On Tue, 2016-02-02 at 19:39 +0100, Ksenija Stanojevic wrote:
> Move panel driver from drivers/staging/panel to drivers/misc.
> 
> Signed-off-by: Ksenija Stanojevic 
> ---
> Changes in v3:
>   - modify driver location in MAINTAINERS file
[]
> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -10393,8 +10393,9 @@ F:drivers/staging/nvec/
>  
>  STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
>  M:   Willy Tarreau 
> +M:   Ksenija Stanojevic 
>  S:   Odd Fixes
> -F:   drivers/staging/panel/
> +F:   drivers/misc/

Not unless you want to be responsible for all of drivers/misc.

F:  Documentation/misc-devices/lcd-panel-cgram.txt
F:  drivers/misc/panel.c

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojević
Hi Greg,

On Tue, Feb 2, 2016 at 5:23 PM, Greg KH  wrote:
> On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
>> Move panel driver from drivers/staging/panel to drivers/misc.
>>
>> Signed-off-by: Ksenija Stanojevic 
>> ---
>>  drivers/misc/Kconfig  |  278 
>>  drivers/misc/Makefile |1 +
>>  drivers/misc/panel.c  | 2445 
>> +
>>  drivers/staging/Kconfig   |2 -
>>  drivers/staging/Makefile  |1 -
>>  drivers/staging/panel/Kconfig |  278 
>>  drivers/staging/panel/Makefile|1 -
>>  drivers/staging/panel/TODO|8 -
>>  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
>>  drivers/staging/panel/panel.c | 2445 
>> -
>>  10 files changed, 2724 insertions(+), 2759 deletions(-)
>>  create mode 100644 drivers/misc/panel.c
>>  delete mode 100644 drivers/staging/panel/Kconfig
>>  delete mode 100644 drivers/staging/panel/Makefile
>>  delete mode 100644 drivers/staging/panel/TODO
>>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
>>  delete mode 100644 drivers/staging/panel/panel.c
>
>
> Can you generate a patch like this with the -M option to git
> format-patch?

I tried that but it didn't change anything.
Also, should panel driver have a separate directory in drivers/misc?
I didn't make one.

>It will show the files being moved, not being deleted and
> added again, making it much easier to see that nothing is changing
> during the move.

Ksenija
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Sudip Mukherjee
On Tue, Feb 02, 2016 at 08:23:20AM -0800, Greg KH wrote:
> On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
> > Move panel driver from drivers/staging/panel to drivers/misc.
> > 
> > Signed-off-by: Ksenija Stanojevic 
> > ---
> >  drivers/misc/Kconfig  |  278 
> >  drivers/misc/Makefile |1 +
> >  drivers/misc/panel.c  | 2445 
> > +
> >  drivers/staging/Kconfig   |2 -
> >  drivers/staging/Makefile  |1 -
> >  drivers/staging/panel/Kconfig |  278 
> >  drivers/staging/panel/Makefile|1 -
> >  drivers/staging/panel/TODO|8 -
> >  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
> >  drivers/staging/panel/panel.c | 2445 
> > -
> >  10 files changed, 2724 insertions(+), 2759 deletions(-)
> >  create mode 100644 drivers/misc/panel.c
> >  delete mode 100644 drivers/staging/panel/Kconfig
> >  delete mode 100644 drivers/staging/panel/Makefile
> >  delete mode 100644 drivers/staging/panel/TODO
> >  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
> >  delete mode 100644 drivers/staging/panel/panel.c
> 
> 
> Can you generate a patch like this with the -M option to git
> format-patch?  It will show the files being moved, not being deleted and
> added again, making it much easier to see that nothing is changing
> during the move.

while at it please modify the MAINTAINERS file also.

regards
sudip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Greg KH
On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
> Move panel driver from drivers/staging/panel to drivers/misc.
> 
> Signed-off-by: Ksenija Stanojevic 
> ---
>  drivers/misc/Kconfig  |  278 
>  drivers/misc/Makefile |1 +
>  drivers/misc/panel.c  | 2445 
> +
>  drivers/staging/Kconfig   |2 -
>  drivers/staging/Makefile  |1 -
>  drivers/staging/panel/Kconfig |  278 
>  drivers/staging/panel/Makefile|1 -
>  drivers/staging/panel/TODO|8 -
>  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
>  drivers/staging/panel/panel.c | 2445 
> -
>  10 files changed, 2724 insertions(+), 2759 deletions(-)
>  create mode 100644 drivers/misc/panel.c
>  delete mode 100644 drivers/staging/panel/Kconfig
>  delete mode 100644 drivers/staging/panel/Makefile
>  delete mode 100644 drivers/staging/panel/TODO
>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
>  delete mode 100644 drivers/staging/panel/panel.c


Can you generate a patch like this with the -M option to git
format-patch?  It will show the files being moved, not being deleted and
added again, making it much easier to see that nothing is changing
during the move.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojević
On Tue, Feb 2, 2016 at 6:14 PM, Greg KH  wrote:
> On Tue, Feb 02, 2016 at 05:48:56PM +0100, Ksenija Stanojević wrote:
>> Hi Greg,
>>
>> On Tue, Feb 2, 2016 at 5:23 PM, Greg KH  wrote:
>> > On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
>> >> Move panel driver from drivers/staging/panel to drivers/misc.
>> >>
>> >> Signed-off-by: Ksenija Stanojevic 
>> >> ---
>> >>  drivers/misc/Kconfig  |  278 
>> >>  drivers/misc/Makefile |1 +
>> >>  drivers/misc/panel.c  | 2445 
>> >> +
>> >>  drivers/staging/Kconfig   |2 -
>> >>  drivers/staging/Makefile  |1 -
>> >>  drivers/staging/panel/Kconfig |  278 
>> >>  drivers/staging/panel/Makefile|1 -
>> >>  drivers/staging/panel/TODO|8 -
>> >>  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
>> >>  drivers/staging/panel/panel.c | 2445 
>> >> -
>> >>  10 files changed, 2724 insertions(+), 2759 deletions(-)
>> >>  create mode 100644 drivers/misc/panel.c
>> >>  delete mode 100644 drivers/staging/panel/Kconfig
>> >>  delete mode 100644 drivers/staging/panel/Makefile
>> >>  delete mode 100644 drivers/staging/panel/TODO
>> >>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
>> >>  delete mode 100644 drivers/staging/panel/panel.c
>> >
>> >
>> > Can you generate a patch like this with the -M option to git
>> > format-patch?
>>
>> I tried that but it didn't change anything.
>
> It worked for me:
>
>  drivers/misc/Kconfig  | 278 
> ++
>  drivers/misc/Makefile |   1 +
>  drivers/{staging/panel => misc}/panel.c   |   0
>  drivers/staging/Kconfig   |   2 -
>  drivers/staging/Makefile  |   1 -
>  drivers/staging/panel/Kconfig | 278 
> --
>  drivers/staging/panel/Makefile|   1 -
>  drivers/staging/panel/TODO|   8 -
>  drivers/staging/panel/lcd-panel-cgram.txt |  24 ---
>  9 files changed, 279 insertions(+), 314 deletions(-)
>  rename drivers/{staging/panel => misc}/panel.c (100%)
>  delete mode 100644 drivers/staging/panel/Kconfig
>  delete mode 100644 drivers/staging/panel/Makefile
>  delete mode 100644 drivers/staging/panel/TODO
>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
>
> See the lines that show the file being renamed?
>
> How exactly did you export the patch?

git fomat-patch HEAD^ -M

>> Also, should panel driver have a separate directory in drivers/misc?
>
> For a single driver, I wouldn't worry about that, putting it in misc/ is fine.
> But, you dropped the lcd-panel-cgram.txt file, perhaps you want to keep that
> somewhere in Documentation/ ?

Yes, I wasn't sure about that file, I can place it in Documentation/misc-devices
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Greg KH
On Tue, Feb 02, 2016 at 05:48:56PM +0100, Ksenija Stanojević wrote:
> Hi Greg,
> 
> On Tue, Feb 2, 2016 at 5:23 PM, Greg KH  wrote:
> > On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
> >> Move panel driver from drivers/staging/panel to drivers/misc.
> >>
> >> Signed-off-by: Ksenija Stanojevic 
> >> ---
> >>  drivers/misc/Kconfig  |  278 
> >>  drivers/misc/Makefile |1 +
> >>  drivers/misc/panel.c  | 2445 
> >> +
> >>  drivers/staging/Kconfig   |2 -
> >>  drivers/staging/Makefile  |1 -
> >>  drivers/staging/panel/Kconfig |  278 
> >>  drivers/staging/panel/Makefile|1 -
> >>  drivers/staging/panel/TODO|8 -
> >>  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
> >>  drivers/staging/panel/panel.c | 2445 
> >> -
> >>  10 files changed, 2724 insertions(+), 2759 deletions(-)
> >>  create mode 100644 drivers/misc/panel.c
> >>  delete mode 100644 drivers/staging/panel/Kconfig
> >>  delete mode 100644 drivers/staging/panel/Makefile
> >>  delete mode 100644 drivers/staging/panel/TODO
> >>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
> >>  delete mode 100644 drivers/staging/panel/panel.c
> >
> >
> > Can you generate a patch like this with the -M option to git
> > format-patch?
> 
> I tried that but it didn't change anything.

It worked for me:

 drivers/misc/Kconfig  | 278 ++
 drivers/misc/Makefile |   1 +
 drivers/{staging/panel => misc}/panel.c   |   0
 drivers/staging/Kconfig   |   2 -
 drivers/staging/Makefile  |   1 -
 drivers/staging/panel/Kconfig | 278 --
 drivers/staging/panel/Makefile|   1 -
 drivers/staging/panel/TODO|   8 -
 drivers/staging/panel/lcd-panel-cgram.txt |  24 ---
 9 files changed, 279 insertions(+), 314 deletions(-)
 rename drivers/{staging/panel => misc}/panel.c (100%)
 delete mode 100644 drivers/staging/panel/Kconfig
 delete mode 100644 drivers/staging/panel/Makefile
 delete mode 100644 drivers/staging/panel/TODO
 delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt

See the lines that show the file being renamed?

How exactly did you export the patch?

> Also, should panel driver have a separate directory in drivers/misc?

For a single driver, I wouldn't worry about that, putting it in misc/ is fine.
But, you dropped the lcd-panel-cgram.txt file, perhaps you want to keep that
somewhere in Documentation/ ?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] misc: Move panel driver out of staging

2016-02-02 Thread Greg KH
On Tue, Feb 02, 2016 at 06:19:43PM +0100, Ksenija Stanojević wrote:
> On Tue, Feb 2, 2016 at 6:14 PM, Greg KH  wrote:
> > On Tue, Feb 02, 2016 at 05:48:56PM +0100, Ksenija Stanojević wrote:
> >> Hi Greg,
> >>
> >> On Tue, Feb 2, 2016 at 5:23 PM, Greg KH  wrote:
> >> > On Tue, Feb 02, 2016 at 03:38:21PM +0100, Ksenija Stanojevic wrote:
> >> >> Move panel driver from drivers/staging/panel to drivers/misc.
> >> >>
> >> >> Signed-off-by: Ksenija Stanojevic 
> >> >> ---
> >> >>  drivers/misc/Kconfig  |  278 
> >> >>  drivers/misc/Makefile |1 +
> >> >>  drivers/misc/panel.c  | 2445 
> >> >> +
> >> >>  drivers/staging/Kconfig   |2 -
> >> >>  drivers/staging/Makefile  |1 -
> >> >>  drivers/staging/panel/Kconfig |  278 
> >> >>  drivers/staging/panel/Makefile|1 -
> >> >>  drivers/staging/panel/TODO|8 -
> >> >>  drivers/staging/panel/lcd-panel-cgram.txt |   24 -
> >> >>  drivers/staging/panel/panel.c | 2445 
> >> >> -
> >> >>  10 files changed, 2724 insertions(+), 2759 deletions(-)
> >> >>  create mode 100644 drivers/misc/panel.c
> >> >>  delete mode 100644 drivers/staging/panel/Kconfig
> >> >>  delete mode 100644 drivers/staging/panel/Makefile
> >> >>  delete mode 100644 drivers/staging/panel/TODO
> >> >>  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
> >> >>  delete mode 100644 drivers/staging/panel/panel.c
> >> >
> >> >
> >> > Can you generate a patch like this with the -M option to git
> >> > format-patch?
> >>
> >> I tried that but it didn't change anything.
> >
> > It worked for me:
> >
> >  drivers/misc/Kconfig  | 278 
> > ++
> >  drivers/misc/Makefile |   1 +
> >  drivers/{staging/panel => misc}/panel.c   |   0
> >  drivers/staging/Kconfig   |   2 -
> >  drivers/staging/Makefile  |   1 -
> >  drivers/staging/panel/Kconfig | 278 
> > --
> >  drivers/staging/panel/Makefile|   1 -
> >  drivers/staging/panel/TODO|   8 -
> >  drivers/staging/panel/lcd-panel-cgram.txt |  24 ---
> >  9 files changed, 279 insertions(+), 314 deletions(-)
> >  rename drivers/{staging/panel => misc}/panel.c (100%)
> >  delete mode 100644 drivers/staging/panel/Kconfig
> >  delete mode 100644 drivers/staging/panel/Makefile
> >  delete mode 100644 drivers/staging/panel/TODO
> >  delete mode 100644 drivers/staging/panel/lcd-panel-cgram.txt
> >
> > See the lines that show the file being renamed?
> >
> > How exactly did you export the patch?
> 
> git fomat-patch HEAD^ -M

I just tried that as well, and got the same result I posted above.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4] misc: Move panel driver out of staging

2016-02-02 Thread Ksenija Stanojevic
Move panel driver from drivers/staging/panel to drivers/misc.

Signed-off-by: Ksenija Stanojevic 
Acked-by: Willy Tarreau 
---
Changes in v4:
- modify driver location in MAINTAINERS file

Changes in v3:
- modify driver location in MAINTAINERS file

Changes in v2:
- modify MAINTAINERS file
- move lcd-panel-cgram.txt to Documentation/

 .../misc-devices}/lcd-panel-cgram.txt  |   0
 MAINTAINERS|   4 +-
 drivers/misc/Kconfig   | 278 +
 drivers/misc/Makefile  |   1 +
 drivers/{staging/panel => misc}/panel.c|   0
 drivers/staging/Kconfig|   2 -
 drivers/staging/Makefile   |   1 -
 drivers/staging/panel/Kconfig  | 278 -
 drivers/staging/panel/Makefile |   1 -
 drivers/staging/panel/TODO |   8 -
 10 files changed, 282 insertions(+), 291 deletions(-)
 rename {drivers/staging/panel => 
Documentation/misc-devices}/lcd-panel-cgram.txt (100%)
 rename drivers/{staging/panel => misc}/panel.c (100%)
 delete mode 100644 drivers/staging/panel/Kconfig
 delete mode 100644 drivers/staging/panel/Makefile
 delete mode 100644 drivers/staging/panel/TODO

diff --git a/drivers/staging/panel/lcd-panel-cgram.txt 
b/Documentation/misc-devices/lcd-panel-cgram.txt
similarity index 100%
rename from drivers/staging/panel/lcd-panel-cgram.txt
rename to Documentation/misc-devices/lcd-panel-cgram.txt
diff --git a/MAINTAINERS b/MAINTAINERS
index 369f6ae..62d8bcd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10393,8 +10393,10 @@ F: drivers/staging/nvec/
 
 STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
 M: Willy Tarreau 
+M: Ksenija Stanojevic 
 S: Odd Fixes
-F: drivers/staging/panel/
+F: Documentation/misc-devices/lcd-panel-cgram.txt
+F: drivers/misc/panel.c
 
 STAGING - REALTEK RTL8712U DRIVERS
 M: Larry Finger 
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 054fc10..f0ba782 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -525,6 +525,284 @@ config VEXPRESS_SYSCFG
  ARM Ltd. Versatile Express uses specialised platform configuration
  bus. System Configuration interface is one of the possible means
  of generating transactions on this bus.
+config PANEL
+   tristate "Parallel port LCD/Keypad Panel support"
+   depends on PARPORT
+   ---help---
+ Say Y here if you have an HD44780 or KS-0074 LCD connected to your
+ parallel port. This driver also features 4 and 6-key keypads. The LCD
+ is accessible through the /dev/lcd char device (10, 156), and the
+ keypad through /dev/keypad (10, 185). Both require misc device to be
+ enabled. This code can either be compiled as a module, or linked into
+ the kernel and started at boot. If you don't understand what all this
+ is about, say N.
+
+config PANEL_PARPORT
+   int "Default parallel port number (0=LPT1)"
+   depends on PANEL
+   range 0 255
+   default "0"
+   ---help---
+ This is the index of the parallel port the panel is connected to. One
+ driver instance only supports one parallel port, so if your keypad
+ and LCD are connected to two separate ports, you have to start two
+ modules with different arguments. Numbering starts with '0' for LPT1,
+ and so on.
+
+config PANEL_PROFILE
+   int "Default panel profile (0-5, 0=custom)"
+   depends on PANEL
+   range 0 5
+   default "5"
+   ---help---
+ To ease configuration, the driver supports different configuration
+ profiles for past and recent wirings. These profiles can also be
+ used to define an approximative configuration, completed by a few
+ other options. Here are the profiles :
+
+   0 = custom (see further)
+   1 = 2x16 parallel LCD, old keypad
+   2 = 2x16 serial LCD (KS-0074), new keypad
+   3 = 2x16 parallel LCD (Hantronix), no keypad
+   4 = 2x16 parallel LCD (Nexcom NSA1045) with Nexcom's keypad
+   5 = 2x40 parallel LCD (old one), with old keypad
+
+ Custom configurations allow you to define how your display is
+ wired to the parallel port, and how it works. This is only intended
+ for experts.
+
+config PANEL_KEYPAD
+   depends on PANEL && PANEL_PROFILE="0"
+   int "Keypad type (0=none, 1=old 6 keys, 2=new 6 keys, 3=Nexcom 4 keys)"
+   range 0 3
+   default 0
+   ---help---
+ This enables and configures a keypad connected to the parallel port.
+ The keys will be read from character device 10,185. Valid values are :
+
+   0 : do not enable 

Move panel driver out of staging?

2015-12-28 Thread Ksenija Stanojević
Hi Willy,

I'm helping Greg do a bit of cleanup in the staging tree, I noticed that
panel driver is maybe ready to be moved to drivers/misc. Are there any
TODO tasks left to do? I already sent checkpatch clean-up patches.

Thanks,
Ksenija
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Move panel driver out of staging?

2015-12-28 Thread Dan Carpenter
On Mon, Dec 28, 2015 at 12:32:39PM +0100, Ksenija Stanojević wrote:
> Hi Willy,
> 
> I'm helping Greg do a bit of cleanup in the staging tree, I noticed that
> panel driver is maybe ready to be moved to drivers/misc. Are there any
> TODO tasks left to do? I already sent checkpatch clean-up patches.
> 

I feel like lcd_write_data() should take a u8 instead of an int.  Or
possibly a char, I suppose.

Could we tighten the checking in input_name2mask() a bit?

drivers/staging/panel/panel.c
  2044  static int input_name2mask(const char *name, pmask_t *mask, pmask_t 
*value,
  2045 char *imask, char *omask)
  2046  {
  2047  static char sigtab[10] = "EeSsPpAaBb";
  2048  char im, om;

Om is 8 bits (signed or not depending on the arch).

  2049  pmask_t m, v;
  2050  
  2051  om = 0ULL;
  2052  im = 0ULL;
  2053  m = 0ULL;
  2054  v = 0ULL;
  2055  while (*name) {
  2056  int in, out, bit, neg;
  2057  
  2058  for (in = 0; (in < sizeof(sigtab)) && (sigtab[in] != 
*name);
  2059   in++)
  2060  ;
  2061  
  2062  if (in >= sizeof(sigtab))
  2063  return 0;   /* input name not found */
  2064  neg = (in & 1); /* odd (lower) names are negated */
  2065  in >>= 1;
  2066  im |= BIT(in);
  2067  
  2068  name++;
  2069  if (isdigit(*name)) {
  2070  out = *name - '0';
  2071  om |= BIT(out);
^^
out is 0-9 so it's too much for "om".  I don't know if this causes a
problem, but let's remove the question by adding a check for illegal
values.
if (*name >= '0' && *name <= '7') {


  2072  } else if (*name == '-') {
  2073  out = 8;
  2074  } else {
  2075  return 0;   /* unknown bit name */
  2076  }
  2077  
  2078  bit = (out * 5) + in;
  2079  
  2080  m |= 1ULL << bit;
  2081  if (!neg)
  2082  v |= 1ULL << bit;
  2083  name++;
  2084  }
  2085  *mask = m;
  2086  *value = v;
  2087  if (imask)
  2088  *imask |= im;
  2089  if (imask)
  2090  *imask |= im;
  2091  if (omask)
  2092  *omask |= om;

It's too much for omask also.

  2093  return 1;
  2094  }

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Move panel driver out of staging?

2015-12-28 Thread Willy Tarreau
Hi Dan,

Thanks for your review, I'm adding a few extra comments below.

On Mon, Dec 28, 2015 at 06:27:36PM +0300, Dan Carpenter wrote:
> On Mon, Dec 28, 2015 at 12:32:39PM +0100, Ksenija Stanojevi?? wrote:
> > Hi Willy,
> > 
> > I'm helping Greg do a bit of cleanup in the staging tree, I noticed that
> > panel driver is maybe ready to be moved to drivers/misc. Are there any
> > TODO tasks left to do? I already sent checkpatch clean-up patches.
> > 
> 
> I feel like lcd_write_data() should take a u8 instead of an int.  Or
> possibly a char, I suppose.

Looks like so indeed.

> Could we tighten the checking in input_name2mask() a bit?
> 
> drivers/staging/panel/panel.c
>   2044  static int input_name2mask(const char *name, pmask_t *mask, pmask_t 
> *value,
>   2045 char *imask, char *omask)
>   2046  {
>   2047  static char sigtab[10] = "EeSsPpAaBb";
>   2048  char im, om;
> 
> Om is 8 bits (signed or not depending on the arch).
> 
>   2049  pmask_t m, v;

I don't know what pmask_t is but I think it should be an opportunity to get
rid of it if it's a scalar.

>   2050  
>   2051  om = 0ULL;
>   2052  im = 0ULL;
>   2053  m = 0ULL;
>   2054  v = 0ULL;

ULL is useless here BTW.

>   2055  while (*name) {
>   2056  int in, out, bit, neg;
>   2057  
>   2058  for (in = 0; (in < sizeof(sigtab)) && (sigtab[in] != 
> *name);
>   2059   in++)
>   2060  ;

The 80-chars limit makes this statement even more confusing than needed.
Possibly it should be broken into 3 different lines.

>   2061  
>   2062  if (in >= sizeof(sigtab))
>   2063  return 0;   /* input name not found */
>   2064  neg = (in & 1); /* odd (lower) names are negated */
>   2065  in >>= 1;
>   2066  im |= BIT(in);
>   2067  
>   2068  name++;
>   2069  if (isdigit(*name)) {
>   2070  out = *name - '0';
>   2071  om |= BIT(out);
> ^^
> out is 0-9 so it's too much for "om".  I don't know if this causes a
> problem, but let's remove the question by adding a check for illegal
> values.
>   if (*name >= '0' && *name <= '7') {

It's very old memories for me now but looking at this code I guess these
are the digits corresponding to the data bits of the parallel port. Thus
indeed such a control is needed to remove any doubt.

>   2072  } else if (*name == '-') {
>   2073  out = 8;
>   2074  } else {
>   2075  return 0;   /* unknown bit name */
>   2076  }
>   2077  
>   2078  bit = (out * 5) + in;
>   2079  
>   2080  m |= 1ULL << bit;
>   2081  if (!neg)
>   2082  v |= 1ULL << bit;

We can remove ULL here and there as well I guess.

>   2083  name++;
>   2084  }
>   2085  *mask = m;
>   2086  *value = v;
>   2087  if (imask)
>   2088  *imask |= im;
>   2089  if (imask)
>   2090  *imask |= im;
>   2091  if (omask)
>   2092  *omask |= om;
> 
> It's too much for omask also.

Yes, let's have om and friends be declared u8 to remove any confusion if
that describes the 8 bits of the data bus on the parallel port. It will
be much saner.

Ksenija, are you interested in trying to address this ?

Thanks!
Willy

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel