FW: LED driver

srinivas.surabhi at wipro.com srinivas.surabhi at wipro.com
Thu Mar 17 23:47:24 EST 2005


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.



More information about the Linuxppc-embedded mailing list