Hi Joel, Sancho,

Maybe you still have the led problem on the ALIX 3C3?
I Checked the CS5536 datasheet and seems that the chip is not rightly configured to
use the leds-alix without any reconfig.

on my machines after boot (with still old bios (before July 2008))

led1 was not set as output
led2 was configured as input...
led3 was configured to aux1

see the testled output (check if "before" and "after" differ) on your machine.

After running testled, leds-alix should work.

Cheers,

Bart Jooris
Researcher
IBBT-IBCN research group-Ghent University




Joel Carter wrote:

Hi Sancho.

I posed this question awhile ago to the list and never got a resolution for getting the LED's working on my 3c3. I have to agree that it must be something to do with the different BIOS since I also have a 3c1 and just tried it as suggested in the Voyage README and it worked perfectly:

$modprobe leds-alix
$echo 1 > /sys/class/leds/alix\:2/brightness

Joel.

------------------------------------------------------------------------

_______________________________________________
Voyage-linux mailing list
[email protected]
http://list.voyage.hk/mailman/listinfo/voyage-linux

/*                                                                      tab:4
* Copyright (c) 2008 Ghent University    
* All rights reserved.
 *
 * @author Bart Jooris
 * 
 * IBBT - IBCN research group - Ghent University
 * E-mail: Bart.Jooris  intec.UGent.be
 * Implementation testleds alix3c3.
 * After config of GPIO 6, 25 and 27 (see schematics of ALIX3C3)
 * all leds will be disabled
 * then every second a led will be enabled
 * 
 * compile with: gcc testled.c -o testled      
 **/


#define extern static
#include <asm/io.h>
#undef extern
#include <stdio.h>
#include <sys/ioctl.h>

#define CS5536_BASE 0x06100
#define CLEAR_BIT_6  (unsigned long) 0x00400000
#define SET_BIT_6    (unsigned long) 0x00000040
#define CLEAR_BIT_9  (unsigned long) 0x02000000
#define SET_BIT_9    (unsigned long) 0x00000200
#define CLEAR_BIT_11 (unsigned long) 0x08000000
#define SET_BIT_11   (unsigned long) 0x00000800

void wrapped_outl (char info[], long addr, long value) {
        printf("\n");
        printf("before  %20s: [%X] %8X\n", info, addr, inl_p(addr));
        printf("execute %20s: [%X] %8X\n", "", addr, value);
        outl_p(value,addr);
        printf("after   %20s: [%X] %8X\n", info, addr, inl_p(addr));
}

int main (int argc, char **argv) {
        if (iopl(3)==0) printf("iopl succeeded\n\n");

//-------Begin config-----------------------------------------------------------

//See Registers of CS5536 @ datasheet p 480- 

        //Check LOCK
        wrapped_outl ("l_LOCK",CS5536_BASE+0x03C,0);
        wrapped_outl ("h_LOCK",CS5536_BASE+0x0BC,0);

        //config LED 1 (GPIO 6)
        //Disable INPUT
        wrapped_outl("l_INPUT",CS5536_BASE+0x020,CLEAR_BIT_6);
        //Disable AUX 1
        wrapped_outl("l_AUX1",CS5536_BASE+0x010,CLEAR_BIT_6);
        //Disable AUX 2
        wrapped_outl("l_AUX2",CS5536_BASE+0x014,CLEAR_BIT_6);
        //Enable open drain
        wrapped_outl("l_OPEN_DRAIN",CS5536_BASE+0x008,SET_BIT_6);
        //Enable output
        wrapped_outl("l_OUTPUT",CS5536_BASE+0x004,SET_BIT_6);

        //config LED 2 and 3 (GPIO 25 and 27)
        //Disable INPUT
        wrapped_outl("h_INPUT",CS5536_BASE+0x0A0,CLEAR_BIT_9 | CLEAR_BIT_11);
        //Disable AUX 1
        wrapped_outl("h_AUX1",CS5536_BASE+0x090,CLEAR_BIT_9 | CLEAR_BIT_11);
        //Disable AUX 2
        wrapped_outl("h_AUX2",CS5536_BASE+0x094,CLEAR_BIT_9 | CLEAR_BIT_11);
        //Enable open drain
        wrapped_outl("h_OPEN_DRAIN",CS5536_BASE+0x088,SET_BIT_9 | SET_BIT_11);
        //Enable output
        wrapped_outl("h_OUTPUT",CS5536_BASE+0x084,SET_BIT_9 | SET_BIT_11);

//-------End of 
config-----------------------------------------------------------

        printf("Disable all leds\n");
        //Disable LED1
        wrapped_outl("l_PINS",CS5536_BASE+0x000, SET_BIT_6);
        //disable LED 2 and 3
        wrapped_outl("h_PINS",CS5536_BASE+0x080, SET_BIT_9 | SET_BIT_11);

        sleep(1);
        printf("Enable led 1\n");
        //Enable LED1
        wrapped_outl("l_PINS",CS5536_BASE+0x000, CLEAR_BIT_6);

        sleep(1);
        printf("Enable led 2\n");
        //Enable LED2
        wrapped_outl("h_PINS",CS5536_BASE+0x080, CLEAR_BIT_9);

        sleep(1);
        printf("Enable led 3\n");
        //Enable LED3
        wrapped_outl("h_PINS",CS5536_BASE+0x080, CLEAR_BIT_11);
}

_______________________________________________
Voyage-linux mailing list
[email protected]
http://list.voyage.hk/mailman/listinfo/voyage-linux

Reply via email to