* [PATCH] ibm ocp gpio
@ 2002-05-21 1:26 andrew may
2002-05-21 9:11 ` Kenneth Johansson
0 siblings, 1 reply; 6+ messages in thread
From: andrew may @ 2002-05-21 1:26 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Armin Kuster
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
The most common thing I want to use the GPIO pins for is
simple lighting of some LED's. I decided to roll in some timers
into the generic GPIO driver rather than haveing each user of the
GPIO driver be forced to do some form of timers to get a usable
LED visual as well.
I think I got the timer stuff correct but I am not sure.
I didn't bother cleaning it up until I get some feedback on it.
[-- Attachment #2: gpio.patch.gz --]
[-- Type: application/octet-stream, Size: 1116 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ibm ocp gpio
2002-05-21 1:26 [PATCH] ibm ocp gpio andrew may
@ 2002-05-21 9:11 ` Kenneth Johansson
2002-05-21 16:08 ` andrew may
0 siblings, 1 reply; 6+ messages in thread
From: Kenneth Johansson @ 2002-05-21 9:11 UTC (permalink / raw)
To: andrew may; +Cc: linuxppc-embedded, Armin Kuster
andrew may wrote:
>
> The most common thing I want to use the GPIO pins for is
> simple lighting of some LED's. I decided to roll in some timers
> into the generic GPIO driver rather than haveing each user of the
> GPIO driver be forced to do some form of timers to get a usable
> LED visual as well.
>
> I think I got the timer stuff correct but I am not sure.
> I didn't bother cleaning it up until I get some feedback on it.
>
> -----------------------------------------------------------------------------
> Name: gpio.patch.gz
> gpio.patch.gz Type: unspecified type (application/octet-stream)
> Encoding: base64
I don't think we should add this It's not really something that needs to be
done in the driver. Also you have not exported this functionality to
userspace.
--
Kenneth Johansson
Ericsson AB Tel: +46 8 404 71 83
Borgafjordsgatan 9 Fax: +46 8 404 72 72
164 80 Stockholm kenneth.johansson@etx.ericsson.se
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ibm ocp gpio
2002-05-21 9:11 ` Kenneth Johansson
@ 2002-05-21 16:08 ` andrew may
2002-05-21 16:28 ` Kenneth Johansson
0 siblings, 1 reply; 6+ messages in thread
From: andrew may @ 2002-05-21 16:08 UTC (permalink / raw)
To: Kenneth Johansson; +Cc: andrew may, linuxppc-embedded, Armin Kuster
On Tue, May 21, 2002 at 11:11:33AM +0200, Kenneth Johansson wrote:
> andrew may wrote:
> >
> > The most common thing I want to use the GPIO pins for is
> > simple lighting of some LED's. I decided to roll in some timers
> > into the generic GPIO driver rather than haveing each user of the
> > GPIO driver be forced to do some form of timers to get a usable
> > LED visual as well.
> >
> > I think I got the timer stuff correct but I am not sure.
> > I didn't bother cleaning it up until I get some feedback on it.
>
> I don't think we should add this It's not really something that needs to be
> done in the driver. Also you have not exported this functionality to
> userspace.
Well no it doesn't need to be in the driver, but you then are forced with
having every other driver doing there own timer to turn off the bit rather
than having one timer take care of them all. And do you really want to
have you UserSpace app wake up and do an ioctl just to turn off an LED
a quarter second after you turn it on?
As I said I didn't clean it up. That would include not having it exported
as an ioctl or having the symbol export to modules. Or making it a config
option to compile it out if you are worried about the size of the code.
Or removing the extra printk's.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ibm ocp gpio
2002-05-21 16:08 ` andrew may
@ 2002-05-21 16:28 ` Kenneth Johansson
2002-05-21 18:26 ` andrew may
0 siblings, 1 reply; 6+ messages in thread
From: Kenneth Johansson @ 2002-05-21 16:28 UTC (permalink / raw)
To: andrew may; +Cc: Kenneth Johansson, Linuxppc embedded, Armin Kuster
On Tue, 2002-05-21 at 18:08, andrew may wrote:
> Well no it doesn't need to be in the driver, but you then are forced with
> having every other driver doing there own timer to turn off the bit rather
> than having one timer take care of them all. And do you really want to
Well I don't think that would be a problem and if we are talking led's
its not going to happen more than a few time a second you have to see
the thing flash. I don't want more code in the kernel than absolutely
necessary all it takes is one bug.
If you really want to make something that can't be done other than in
the driver it's some type of streaming mode and then you have to have
timers to control the speed. Think any card that needs to program sram
based FPGA it would probably go many times faster than todays interface.
--
Kenneth Johansson
Ericsson AB Tel: +46 8 404 71 83
Borgafjordsgatan 9 Fax: +46 8 404 72 72
164 80 Stockholm kenneth.johansson@etx.ericsson.se
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ibm ocp gpio
2002-05-21 16:28 ` Kenneth Johansson
@ 2002-05-21 18:26 ` andrew may
2002-05-22 10:58 ` Kenneth Johansson
0 siblings, 1 reply; 6+ messages in thread
From: andrew may @ 2002-05-21 18:26 UTC (permalink / raw)
To: Kenneth Johansson
Cc: andrew may, Kenneth Johansson, Linuxppc embedded, Armin Kuster
On Tue, May 21, 2002 at 06:28:41PM +0200, Kenneth Johansson wrote:
> On Tue, 2002-05-21 at 18:08, andrew may wrote:
>
> > Well no it doesn't need to be in the driver, but you then are forced with
> > having every other driver doing there own timer to turn off the bit rather
> > than having one timer take care of them all. And do you really want to
>
> Well I don't think that would be a problem and if we are talking led's
> its not going to happen more than a few time a second you have to see
> the thing flash. I don't want more code in the kernel than absolutely
> necessary all it takes is one bug.
>
> If you really want to make something that can't be done other than in
> the driver it's some type of streaming mode and then you have to have
> timers to control the speed. Think any card that needs to program sram
> based FPGA it would probably go many times faster than todays interface.
Look at the code and stop the hand-waving generalities.
The other motto of the kernel is do it once right. If this code is not
there every thing that just wants to turn on a LED for a half second needs
to do their own timer. I have a couple drivers where I use some LED's on the
GPIO pins and I don't want to do a timer in each one of them.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ibm ocp gpio
2002-05-21 18:26 ` andrew may
@ 2002-05-22 10:58 ` Kenneth Johansson
0 siblings, 0 replies; 6+ messages in thread
From: Kenneth Johansson @ 2002-05-22 10:58 UTC (permalink / raw)
To: andrew may; +Cc: Kenneth Johansson, Linuxppc embedded, Armin Kuster
On Tue, 2002-05-21 at 20:26, andrew may wrote:
>
> On Tue, May 21, 2002 at 06:28:41PM +0200, Kenneth Johansson wrote:
> > On Tue, 2002-05-21 at 18:08, andrew may wrote:
> >
> > > Well no it doesn't need to be in the driver, but you then are forced with
> > > having every other driver doing there own timer to turn off the bit rather
> > > than having one timer take care of them all. And do you really want to
> >
> > Well I don't think that would be a problem and if we are talking led's
> > its not going to happen more than a few time a second you have to see
> > the thing flash. I don't want more code in the kernel than absolutely
> > necessary all it takes is one bug.
> >
> > If you really want to make something that can't be done other than in
> > the driver it's some type of streaming mode and then you have to have
> > timers to control the speed. Think any card that needs to program sram
> > based FPGA it would probably go many times faster than todays interface.
>
> Look at the code and stop the hand-waving generalities.
relax I did not say your code was buggy it was more .. well general
hand-waving :)
> The other motto of the kernel is do it once right. If this code is not
> there every thing that just wants to turn on a LED for a half second needs
> to do their own timer. I have a couple drivers where I use some LED's on the
> GPIO pins and I don't want to do a timer in each one of them.
I do not see a problem with everyone doing the timers but it's not me
you have to convince I can't commit the code anyway.
It would be better if you made a more generic interface. perhaps
something that took commands in the form of.
struct gpio_command{
int action;
int value;
int ns_wait;
}
action would code in what register to use and if you want to set or
clear the bits specified in value.
Now you could do a mode that loop over an array of this type of
commands.
This would have the "side effect" of speeding up large transfers over
SPI bus or similar things and help you with flashing your led.
--
Kenneth Johansson
Ericsson AB Tel: +46 8 404 71 83
Borgafjordsgatan 9 Fax: +46 8 404 72 72
164 80 Stockholm kenneth.johansson@etx.ericsson.se
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-22 10:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-21 1:26 [PATCH] ibm ocp gpio andrew may
2002-05-21 9:11 ` Kenneth Johansson
2002-05-21 16:08 ` andrew may
2002-05-21 16:28 ` Kenneth Johansson
2002-05-21 18:26 ` andrew may
2002-05-22 10:58 ` Kenneth Johansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).