Changeset 7334


Ignore:
Timestamp:
2007-05-25T01:30:35+02:00 (11 years ago)
Author:
florian
Message:

add generic GPIO to MIPS boards, use it for au1000 and for the MTX-1 led driver as well

Location:
trunk/target/linux
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/au1000-2.6/config/default

    r7103 r7334  
    33CONFIG_64BIT_PHYS_ADDR=y 
    44# CONFIG_8139TOO is not set 
     5# CONFIG_ARCH_HAS_ILOG2_U32 is not set 
     6# CONFIG_ARCH_HAS_ILOG2_U64 is not set 
    57# CONFIG_ATM is not set 
    68# CONFIG_B44 is not set 
    79CONFIG_BASE_SMALL=0 
    8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 
     10CONFIG_BITREVERSE=y 
     11# CONFIG_BROADCOM_PHY is not set 
    912CONFIG_CHR_DEV_SG=m 
    1013CONFIG_CMDLINE="root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit" 
     
    4649CONFIG_ELF_CORE=y 
    4750# CONFIG_ENABLE_MUST_CHECK is not set 
    48 # CONFIG_FIRMWARE_EDID is not set 
    4951# CONFIG_FIXED_PHY is not set 
    5052CONFIG_FS_POSIX_ACL=y 
    5153CONFIG_GENERIC_FIND_NEXT_BIT=y 
     54CONFIG_GENERIC_GPIO=y 
     55# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set 
    5256# CONFIG_GEN_RTC is not set 
    5357# CONFIG_HAMRADIO is not set 
     58CONFIG_HAS_IOMEM=y 
     59CONFIG_HAS_IOPORT=y 
    5460CONFIG_HW_HAS_PCI=y 
    5561CONFIG_HW_RANDOM=y 
     
    6571CONFIG_I2C_ALGOPCA=m 
    6672CONFIG_I2C_ALGOPCF=m 
    67 # CONFIG_I2C_ALI1535 is not set 
    68 # CONFIG_I2C_ALI1563 is not set 
    69 # CONFIG_I2C_ALI15X3 is not set 
    70 # CONFIG_I2C_AMD756 is not set 
    71 # CONFIG_I2C_AMD8111 is not set 
    7273CONFIG_I2C_AU1X00GPIO=m 
    7374CONFIG_I2C_CHARDEV=m 
    74 # CONFIG_I2C_DEBUG_ALGO is not set 
    75 # CONFIG_I2C_DEBUG_BUS is not set 
    76 # CONFIG_I2C_DEBUG_CHIP is not set 
    77 # CONFIG_I2C_DEBUG_CORE is not set 
    78 # CONFIG_I2C_I801 is not set 
    79 # CONFIG_I2C_I810 is not set 
    80 # CONFIG_I2C_NFORCE2 is not set 
    81 # CONFIG_I2C_OCORES is not set 
    82 # CONFIG_I2C_PARPORT_LIGHT is not set 
    83 # CONFIG_I2C_PCA_ISA is not set 
    84 # CONFIG_I2C_PIIX4 is not set 
    85 # CONFIG_I2C_PROSAVAGE is not set 
    86 # CONFIG_I2C_SAVAGE4 is not set 
    87 # CONFIG_I2C_SIS5595 is not set 
    88 # CONFIG_I2C_SIS630 is not set 
    89 # CONFIG_I2C_SIS96X is not set 
    90 # CONFIG_I2C_STUB is not set 
    91 # CONFIG_I2C_VIA is not set 
    92 # CONFIG_I2C_VIAPRO is not set 
    93 # CONFIG_I2C_VOODOO3 is not set 
    9475# CONFIG_IDE is not set 
    9576CONFIG_INITRAMFS_SOURCE="" 
    9677CONFIG_JFFS2_FS_DEBUG=0 
    97 # CONFIG_LAN_SAA9730 is not set 
    9878CONFIG_LEDS_MTX1=y 
    9979# CONFIG_LEDS_TRIGGERS is not set 
     
    10282# CONFIG_MACH_VR41XX is not set 
    10383CONFIG_MAGIC_SYSRQ=y 
    104 CONFIG_MINI_FO=y 
    10584CONFIG_MIPS=y 
    10685# CONFIG_MIPS_ATLAS is not set 
     
    139118# CONFIG_MTD_ABSENT is not set 
    140119# CONFIG_MTD_ALCHEMY is not set 
     120CONFIG_MTD_BLKDEVS=y 
    141121CONFIG_MTD_BLOCK=y 
    142122# CONFIG_MTD_BLOCK2MTD is not set 
     
    183163# CONFIG_NATSEMI is not set 
    184164# CONFIG_NE2K_PCI is not set 
     165CONFIG_NET_SCH_FIFO=y 
    185166# CONFIG_NET_VENDOR_3COM is not set 
     167CONFIG_NF_CONNTRACK=y 
     168CONFIG_NF_CONNTRACK_MARK=y 
     169CONFIG_NF_CT_ACCT=y 
     170# CONFIG_NF_NAT_AMANDA is not set 
     171CONFIG_NF_NAT_FTP=m 
     172CONFIG_NF_NAT_H323=m 
     173CONFIG_NF_NAT_IRC=m 
     174CONFIG_NF_NAT_NEEDED=y 
     175# CONFIG_NF_NAT_PPTP is not set 
     176CONFIG_NF_NAT_SIP=m 
     177# CONFIG_NF_NAT_TFTP is not set 
    186178# CONFIG_PAGE_SIZE_16KB is not set 
    187179CONFIG_PAGE_SIZE_4KB=y 
    188180# CONFIG_PAGE_SIZE_64KB is not set 
    189181# CONFIG_PAGE_SIZE_8KB is not set 
    190 # CONFIG_PCCARD is not set 
    191182# CONFIG_PCIPCWATCHDOG is not set 
    192183CONFIG_PHYLIB=y 
    193 # CONFIG_PM is not set 
    194184# CONFIG_PMC_YOSEMITE is not set 
     185# CONFIG_PNPACPI is not set 
    195186# CONFIG_PNX8550_JBS is not set 
    196 # CONFIG_PNX8550_V2PCI is not set 
     187# CONFIG_PNX8550_STB810 is not set 
    197188# CONFIG_PPP_MPPE is not set 
    198189# CONFIG_PREVENT_FIRMWARE_BUILD is not set 
    199190# CONFIG_QSEMI_PHY is not set 
     191CONFIG_RESOURCES_64BIT=y 
    200192# CONFIG_RTC is not set 
    201193CONFIG_RWSEM_GENERIC_SPINLOCK=y 
     
    203195CONFIG_SCSI_CONSTANTS=y 
    204196# CONFIG_SCSI_PROC_FS is not set 
    205 # CONFIG_SENSORS_DS1337 is not set 
    206 # CONFIG_SENSORS_DS1374 is not set 
    207 # CONFIG_SENSORS_EEPROM is not set 
    208 # CONFIG_SENSORS_MAX6875 is not set 
    209 # CONFIG_SENSORS_PCA9539 is not set 
    210 # CONFIG_SENSORS_PCF8574 is not set 
    211 # CONFIG_SENSORS_PCF8591 is not set 
    212197CONFIG_SERIAL_8250_AU1X00=y 
    213198# CONFIG_SERIAL_8250_EXTENDED is not set 
     
    236221# CONFIG_STANDALONE is not set 
    237222CONFIG_STRIP=m 
    238 CONFIG_SYN_COOKIES=y 
     223CONFIG_SYSVIPC_SYSCTL=y 
    239224CONFIG_SYS_HAS_CPU_MIPS32_R1=y 
    240225CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 
     226CONFIG_SYS_SUPPORTS_APM_EMULATION=y 
    241227CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 
     228CONFIG_SYS_SUPPORTS_KGDB=y 
    242229CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 
    243230# CONFIG_TMD_HERMES is not set 
     
    248235# CONFIG_UNUSED_SYMBOLS is not set 
    249236# CONFIG_USBPCWATCHDOG is not set 
     237# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set 
    250238CONFIG_USB_EHCI_HCD=m 
    251239# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 
    252240# CONFIG_USB_EHCI_SPLIT_ISO is not set 
    253241# CONFIG_USB_EHCI_TT_NEWSCHED is not set 
     242# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 
     243# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 
    254244CONFIG_USB_OHCI_HCD=m 
    255245CONFIG_USB_UHCI_HCD=m 
    256246# CONFIG_VIA_RHINE is not set 
     247CONFIG_ZONE_DMA=y 
     248CONFIG_ZONE_DMA_FLAG=1 
  • trunk/target/linux/au1000-2.6/files/drivers/leds/leds-mtx1.c

    r7290 r7334  
    1515#include <linux/leds.h> 
    1616#include <linux/err.h> 
    17 #include <asm/mach-au1x00/au1000.h> 
     17#include <asm/gpio.h> 
    1818 
    1919static struct platform_device *pdev; 
    2020 
    21 static void mtx1_green_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) 
     21static void mtx1_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) 
    2222{ 
    23         /* The power LED cannot be controlled the same way as for the Status LED */ 
    24         if (brightness) { 
    25                 au_writel( 0x18000800, GPIO2_OUTPUT ); 
    26         } else { 
    27                 au_writel( 0x18000000, GPIO2_OUTPUT); 
    28         } 
    29 } 
    30  
    31 static void mtx1_red_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) 
    32 { 
    33         /* We store GPIO address (originally address - 200) in the "flags" field*/ 
    34         unsigned long pinmask = 1 << led_cdev->flags;  
    35         if (brightness) { 
    36                 au_writel((pinmask << 16) | pinmask, GPIO2_OUTPUT);  
    37         } else {  
    38                 au_writel((pinmask << 16) | 0, GPIO2_OUTPUT); 
    39         } 
     23        if (!strcmp("mtx1:green", led_cdev->name)) 
     24                gpio_set_value(211, brightness ? 1 : 0); 
     25        else 
     26                gpio_set_value(212, brightness ? 1 : 0); 
    4027} 
    4128 
    4229static struct led_classdev mtx1_green_led = { 
    4330        .name = "mtx1:green", 
    44         .brightness_set = mtx1_green_led_set, 
     31        .brightness_set = mtx1_led_set, 
    4532}; 
    4633 
    4734static struct led_classdev mtx1_red_led = { 
    4835        .name = "mtx1:red", 
    49         .flags = 12, 
    50         .brightness_set = mtx1_red_led_set, 
    51         .default_trigger = "ide-disk", 
     36        .brightness_set = mtx1_led_set, 
    5237}; 
    5338 
Note: See TracChangeset for help on using the changeset viewer.