Re: [PATCH RESEND] max3100 driver

2007-12-28 Thread chri
Hi,

On Dec 29, 2007 2:38 AM, Jan Engelhardt <[EMAIL PROTECTED]> wrote:
>
> [4:128] is taken by ttyS64. Please look into Documentation/devices.txt.
>

I did it but I think it's better to reuse a minor from ttyS than
allocating a new major (64 serial ports is a lot). I saw that other
drivers take a similar approach, just tend to stay away from low
numbers that are used by 8250 and its child (that can be connected
more or less everywhere).  Perhaps in these udev times the serial
minor number should be allocated dinamicaly. Do you think this makes
sense?

>
> I notice a steep increase in serial drivers. Everyone got their
> new chips for xmas, eh? :)
>
>

This year I was a bad boy so Santa brought me just a cheap uart. For
next Xmas I hope in a WLAN chip or something like that. ;-)


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RESEND] max3100 driver

2007-12-28 Thread chri
Hi,

On Dec 29, 2007 2:38 AM, Jan Engelhardt [EMAIL PROTECTED] wrote:

 [4:128] is taken by ttyS64. Please look into Documentation/devices.txt.


I did it but I think it's better to reuse a minor from ttyS than
allocating a new major (64 serial ports is a lot). I saw that other
drivers take a similar approach, just tend to stay away from low
numbers that are used by 8250 and its child (that can be connected
more or less everywhere).  Perhaps in these udev times the serial
minor number should be allocated dinamicaly. Do you think this makes
sense?


 I notice a steep increase in serial drivers. Everyone got their
 new chips for xmas, eh? :)



This year I was a bad boy so Santa brought me just a cheap uart. For
next Xmas I hope in a WLAN chip or something like that. ;-)


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] max3100 driver

2007-12-17 Thread chri
On Dec 17, 2007 9:45 AM, Jiri Slaby <[EMAIL PROTECTED]> wrote:
>
> You probably wanted to unregister it after _all_ cards are removed, not after
> each...
>

Hi,

thanks you are right. I haven't noticed this since spi devices are not
hot-pluggable so I could remove them only with rmmod (and so all of
them toghether). Anyway the code I sent is ugly, I will correct and
resend.

>
> Also you should synchronize_irq() after stopping them here.
>

I see. I guess I will have problems on suspending with serial activity
otherwise.

Thanks,


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] max3100 driver

2007-12-17 Thread chri
On Dec 17, 2007 9:45 AM, Jiri Slaby [EMAIL PROTECTED] wrote:

 You probably wanted to unregister it after _all_ cards are removed, not after
 each...


Hi,

thanks you are right. I haven't noticed this since spi devices are not
hot-pluggable so I could remove them only with rmmod (and so all of
them toghether). Anyway the code I sent is ugly, I will correct and
resend.


 Also you should synchronize_irq() after stopping them here.


I see. I guess I will have problems on suspending with serial activity
otherwise.

Thanks,


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] max3100 driver

2007-12-12 Thread chri
Hi,

thank you for your extensive review, I will fix and resubmitt. Anyway
I learned an important lesson: checkpatch.pl will be my best friend.
Sorry I haven't read about it earlier.

Just a question:

>
> > +/*
> > + *
> > + *  Copyright (C) 2007 Christian Pellegrin
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +
> > +#ifndef _LINUX_SERIAL_MAX3100_H
> > +#define _LINUX_SERIAL_MAX3100_H 1
> > +
> > +struct plat_max3100 {
> > + int loopback;
> > +/* force MAX3100 in loopback */
> > + int crystal;
> > +/* 0 for 3.6864 Mhz, 1 for 1.8432  */
> > + int only_edge_irq;
> > +/* for archs like PXA with only edge irqs */
> > +};
>
> Does this header file need to exist?  afaict plat_max3100 is only used by
> drivers/serial/max3100.c and hence could be defined there?
>

It's used in the machine definition file for platform devices that
cannot be autoprobed. Anyway where is the best place to put such
struct definition / include files? And what is the best way to
document them (if not inline)? For example I put in my machine
definition file (let's say arch/arm/mach-s3c2410/mach-smdk2410.c):

static struct plat_max3100 max3100_plat_data = {
.loopback = 0,
.crystal = 0,
.only_edge_irq = 0,
};

static struct spi_board_info spi_board_info[] = {
{
.modalias   = "max3100",
.platform_data  = _plat_data,
.irq= IRQ_EINT12,
.max_speed_hz   = 5*1000*1000,
.chip_select= 0,
},
};

...

   spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));



-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] netmos 9855 fix

2007-12-12 Thread chri
On Dec 12, 2007 10:16 AM, Andrew Morton <[EMAIL PROTECTED]> wrote:

> What was wrong with it?
>

Hi,

on loading only one serial port was present and it wasn't working.
After looking in the data sheet I realized that the base address was
wrong. For further reference here is lspci and relevant dmesg output:

02:00.0 Communication controller: NetMos Technology PCI 9855 Multi-I/O
Controller (rev 01) (prog-if 02)
Subsystem: LSI Logic / Symbios Logic Unknown device 0022
Flags: medium devsel, IRQ 19
I/O ports at df00 [size=8]
I/O ports at de00 [size=8]
I/O ports at dd00 [size=8]
I/O ports at dc00 [size=8]
I/O ports at db00 [size=8]
I/O ports at da00 [size=16]

parport1: PC-style at 0xdd00 [PCSPP,TRISTATE]
parport2: PC-style at 0xdf00 [PCSPP,TRISTATE,EPP]
:02:00.0: ttyS0 at I/O 0xdb00 (irq = 19) is a 16550A
:02:00.0: ttyS1 at I/O 0xda00 (irq = 19) is a 16550A



-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] netmos 9855 fix

2007-12-12 Thread chri
On Dec 12, 2007 10:16 AM, Andrew Morton [EMAIL PROTECTED] wrote:

 What was wrong with it?


Hi,

on loading only one serial port was present and it wasn't working.
After looking in the data sheet I realized that the base address was
wrong. For further reference here is lspci and relevant dmesg output:

02:00.0 Communication controller: NetMos Technology PCI 9855 Multi-I/O
Controller (rev 01) (prog-if 02)
Subsystem: LSI Logic / Symbios Logic Unknown device 0022
Flags: medium devsel, IRQ 19
I/O ports at df00 [size=8]
I/O ports at de00 [size=8]
I/O ports at dd00 [size=8]
I/O ports at dc00 [size=8]
I/O ports at db00 [size=8]
I/O ports at da00 [size=16]

parport1: PC-style at 0xdd00 [PCSPP,TRISTATE]
parport2: PC-style at 0xdf00 [PCSPP,TRISTATE,EPP]
:02:00.0: ttyS0 at I/O 0xdb00 (irq = 19) is a 16550A
:02:00.0: ttyS1 at I/O 0xda00 (irq = 19) is a 16550A



-- 
Christian Pellegrin, see http://www.evolware.org/chri/
Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] max3100 driver

2007-12-12 Thread chri
Hi,

thank you for your extensive review, I will fix and resubmitt. Anyway
I learned an important lesson: checkpatch.pl will be my best friend.
Sorry I haven't read about it earlier.

Just a question:


  +/*
  + *
  + *  Copyright (C) 2007 Christian Pellegrin
  + *
  + * This program is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License as published by
  + * the Free Software Foundation; either version 2 of the License, or
  + * (at your option) any later version.
  + */
  +
  +
  +#ifndef _LINUX_SERIAL_MAX3100_H
  +#define _LINUX_SERIAL_MAX3100_H 1
  +
  +struct plat_max3100 {
  + int loopback;
  +/* force MAX3100 in loopback */
  + int crystal;
  +/* 0 for 3.6864 Mhz, 1 for 1.8432  */
  + int only_edge_irq;
  +/* for archs like PXA with only edge irqs */
  +};

 Does this header file need to exist?  afaict plat_max3100 is only used by
 drivers/serial/max3100.c and hence could be defined there?


It's used in the machine definition file for platform devices that
cannot be autoprobed. Anyway where is the best place to put such
struct definition / include files? And what is the best way to
document them (if not inline)? For example I put in my machine
definition file (let's say arch/arm/mach-s3c2410/mach-smdk2410.c):

static struct plat_max3100 max3100_plat_data = {
.loopback = 0,
.crystal = 0,
.only_edge_irq = 0,
};

static struct spi_board_info spi_board_info[] = {
{
.modalias   = max3100,
.platform_data  = max3100_plat_data,
.irq= IRQ_EINT12,
.max_speed_hz   = 5*1000*1000,
.chip_select= 0,
},
};

...

   spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));



-- 
Christian Pellegrin, see http://www.evolware.org/chri/
Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/