FW: LED driver
Hans Schillstrom
hans.schillstrom at pwav.com
Thu Mar 17 23:53:30 EST 2005
Hi,
Thats right, but the original is for 2.4.2x.
I'll attach the original status_led.c from Denx for you
/Hans
Wolfgang: Sorry about the missing copyright
On Thu, 2005-03-17 at 13:47, srinivas.surabhi at wipro.com wrote:
> Thanks a lot for your help. But in my sources I could not find
> immap_cpm2.h file. There is immap_8260.h file, I don't know it is
> similar to that of immap_cpum2.h.
>
> Can you send the immap_cpum2.h file please?
>
> I am working on kernel 2.4.20
>
> -Thanks once again..
> SS
>
> -----Original Message-----
> From: Hans Schillstrom [mailto:hans.schillstrom at pwav.com]
> Sent: Thursday, March 17, 2005 3:17 PM
> To: Srinivas Surabhi (WT01 - TELECOM SOLUTIONS)
> Cc: linuxppc-embedded at ozlabs.org
> Subject: Re: FW: LED driver
>
> Hi,
> I have made a driver for our mpc8270 board
> It is based upon Denx led_driver and made for 2.6 kernel
> (See atached file)
>
> To control the leds you have to perfom some ioctl's
> first create your devices
> mknod led0 c 151 0 ...
>
> Example howto use it:
>
> void led_off( int file )
> {
> if (ioctl(file,STATUSLED_SET,0) < 0)
> perror("led off: ");
> }
> void led_blink( int file )
> {
> if (ioctl(file,STATUSLED_SET,1) < 0)
> perror("led blink: ");
> }
> void led_on( int file )
> {
> if (ioctl(file,STATUSLED_SET,2) < 0)
> perror("led on: ");
> }
> void led_per( int file, int period )
> {
> if (ioctl(file,STATUSLED_PERIOD,period) < 0)
> perror("led on: ");
> }
>
> ...
>
> int led0 = open("/dev/led0",O_RDWR)
> ...
> led_blink(led0); /* turn on green LED */
> ..
> /Hans
>
>
> On Thu, 2005-03-17 at 06:15, srinivas.surabhi at wipro.com wrote:
> >
> > -----Original Message-----
> > From: Srinivas Surabhi (WT01 - TELECOM SOLUTIONS)
> > Sent: Thursday, March 17, 2005 7:53 AM
> > To: linuxppc-embedded at ozlabs.org
> > Subject: LED driver
> >
> > Hi,
> >
> > I am working on the MPC8270 board having connected GPIO 3 lines
> > connected to 3 LEDs. So can any one help me in finding out the best
> > solution of controlling the LEDs from MVlinux (kernel and user space)
> or
> > any pointers who has done it before.
> >
> > Thanks & Rgds
> > SS
> >
> >
> >
> >
> > Confidentiality Notice
> >
> > The information contained in this electronic message and any
> attachments to this message are intended
> > for the exclusive use of the addressee(s) and may contain confidential
> or privileged information. If
> > you are not the intended recipient, please notify the sender at Wipro
> or Mailadmin at wipro.com immediately
> > and destroy all copies of this message and any attachments.
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded at ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
>
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any attachments to this message are intended
> for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify the sender at Wipro or Mailadmin at wipro.com immediately
> and destroy all copies of this message and any attachments.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: status_led.c
Type: text/x-c
Size: 15945 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050317/5dc1e089/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: status_led.h
Type: text/x-h
Size: 9598 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050317/5dc1e089/attachment-0001.bin
More information about the Linuxppc-embedded
mailing list