FW: LED driver

3 messages, 3 authors, 2005-03-17 · open the first message on its own page

FW: LED driver

From: <hidden>
Date: 2005-03-17 05:11:48



-----Original Message-----
From: Srinivas Surabhi (WT01 - TELECOM SOLUTIONS)=0D
Sent: Thursday, March 17, 2005 7:53 AM
To: <redacted>
Subject: LED driver=0D

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.=0D

Thanks & Rgds
SS=0D




Confidentiality Notice=0D

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@wipro.com immediately
and destroy all copies of this message and any attachments.

RE: LED driver

From: akash kaul <hidden>
Date: 2005-03-17 06:24:24


Hi Surabhi,
 You basically have to write appropriate values into Port data register
corresponding to the GPIO pin to switch the led on or of. The register
can be accessed thru the immap pointer.(i.e internal memory map pointer
)look at the file include/asm-ppc/immap_cpm2.h relative to ur kernel
source base. You will find the mapped register variable in this file.

If you need to access this immap memory from userspace then u have to
make a system call to enter kernel space and access the immap memory.

Regards,
Akash Kaul





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

8 more lines

Re: FW: LED driver

From: Hans Schillstrom <hidden>
Date: 2005-03-17 10:17:41

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

2 more lines

-----Original Message-----
From: Srinivas Surabhi (WT01 - TELECOM SOLUTIONS)
Sent: Thursday, March 17, 2005 7:53 AM
To: <redacted>
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@wipro.com immediately
and destroy all copies of this message and any attachments.
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help