
Thomas Chou wrote:
On 04/20/2010 09:19 PM, Scott McNutt wrote:
+void __led_init(led_id_t mask, int state) +{
- gpio_direction_output(mask, (state == STATUS_LED_ON) ? 0 : 1);
The direction register only exists when the PIO core hardware is configured in bidirectional mode.
If the PIO core hardware is configured in output-only mode, reading from data returns an undefined value.
As I recall, the older designs configured the LED PIO ports as output only ... which is why board/altera/common/epled.c was coded in such a manner.
Hi Scott,
This is not for Altera PIO interface. I followed the gpio interface of Linux, linux-2.6/Documentation/gpio.txt, and created a trivial bit addressing gpio core,
I don't think the Altera board tree is an appropriate place for code that supports custom logic blocks. If an Altera distribution provided a design that included this custom block in one of their board designs then it would probably be fine.
I'm not sure where this should go ... maybe in the driver tree?
Regards, --Scott