Commit a5555708 authored by 吴智聪(John Wu)'s avatar 吴智聪(John Wu)

Merge branch 'neuros' of...

Merge branch 'neuros' of ssh://git@git.neuros.com.cn/git/git-pub/osd20/linux-davinci-2.6 into neuros
parents 7312bff3 7e81604f
...@@ -836,7 +836,18 @@ CONFIG_NEUROS_IR_BLASTER=m ...@@ -836,7 +836,18 @@ CONFIG_NEUROS_IR_BLASTER=m
# Multifunction device drivers # Multifunction device drivers
# #
# CONFIG_MFD_SM501 is not set # CONFIG_MFD_SM501 is not set
# CONFIG_NEW_LEDS is not set CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
#
# LED drivers
#
CONFIG_LEDS_GPIO=y
#
# LED Triggers
#
# CONFIG_LEDS_TRIGGERS is not set
# #
# Multimedia devices # Multimedia devices
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
#include <video/davincifb.h> #include <video/davincifb.h>
#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
#include <asm/arch/mux.h>
#include <asm/arch/gpio.h>
#include <linux/leds.h>
#endif
/* other misc. init functions */ /* other misc. init functions */
void __init davinci_psc_init(void); void __init davinci_psc_init(void);
void __init davinci_irq_init(void); void __init davinci_irq_init(void);
...@@ -246,6 +252,31 @@ static struct platform_device rtc_dev = { ...@@ -246,6 +252,31 @@ static struct platform_device rtc_dev = {
.id = -1, .id = -1,
}; };
/*
* LEDS
*/
#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
struct gpio_led leds[] = {
{ .name = "led1_green", .gpio = GPIO(10) },
{ .name = "led1_red", .gpio = GPIO(11) },
{ .name = "led2_green", .gpio = GPIO(12) },
{ .name = "led2_red", .gpio = GPIO(13) },
};
static struct gpio_led_platform_data leds_data = {
.num_leds = ARRAY_SIZE(leds),
.leds = (void *)leds,
};
static struct platform_device leds_dev = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &leds_data,
},
};
#endif
static struct platform_device *ntosd_644xa_devices[] __initdata = { static struct platform_device *ntosd_644xa_devices[] __initdata = {
&ntosd_644xa_norflash_device, &ntosd_644xa_norflash_device,
#if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) #if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
...@@ -259,6 +290,9 @@ defined(CONFIG_FB_DM) || defined(CONFIG_FB_DM_MODULE) ...@@ -259,6 +290,9 @@ defined(CONFIG_FB_DM) || defined(CONFIG_FB_DM_MODULE)
&usb_dev, &usb_dev,
#endif #endif
&rtc_dev, &rtc_dev,
#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
&leds_dev,
#endif
}; };
static void __init static void __init
...@@ -280,6 +314,14 @@ static __init void ntosd_644xa_init(void) ...@@ -280,6 +314,14 @@ static __init void ntosd_644xa_init(void)
ARRAY_SIZE(ntosd_644xa_devices)); ARRAY_SIZE(ntosd_644xa_devices));
setup_usb(); setup_usb();
#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
davinci_mux_peripheral(DAVINCI_MUX_AEAW0, 0);
davinci_mux_peripheral(DAVINCI_MUX_AEAW1, 0);
davinci_mux_peripheral(DAVINCI_MUX_AEAW2, 0);
davinci_mux_peripheral(DAVINCI_MUX_AEAW3, 0);
davinci_mux_peripheral(DAVINCI_MUX_AEAW4, 0);
davinci_mux_peripheral(DAVINCI_MUX_VLYNQEN, 0);
#endif
} }
static __init void ntosd_644xa_irq_init(void) static __init void ntosd_644xa_irq_init(void)
......
...@@ -501,7 +501,7 @@ static void __devinit nand_davinci_flash_init(void) ...@@ -501,7 +501,7 @@ static void __devinit nand_davinci_flash_init(void)
/* Disable HPI and ATA mux */ /* Disable HPI and ATA mux */
davinci_mux_peripheral(DAVINCI_MUX_HPIEN, 0); davinci_mux_peripheral(DAVINCI_MUX_HPIEN, 0);
davinci_mux_peripheral(DAVINCI_MUX_ATAEN, 0); davinci_mux_peripheral(DAVINCI_MUX_ATAEN, 0);
#ifndef CONFIG_MACH_NTOSD_644XA
/* Enable VLYNQ and AEAW */ /* Enable VLYNQ and AEAW */
davinci_mux_peripheral(DAVINCI_MUX_AEAW0, 1); davinci_mux_peripheral(DAVINCI_MUX_AEAW0, 1);
davinci_mux_peripheral(DAVINCI_MUX_AEAW1, 1); davinci_mux_peripheral(DAVINCI_MUX_AEAW1, 1);
...@@ -510,7 +510,7 @@ static void __devinit nand_davinci_flash_init(void) ...@@ -510,7 +510,7 @@ static void __devinit nand_davinci_flash_init(void)
davinci_mux_peripheral(DAVINCI_MUX_AEAW4, 1); davinci_mux_peripheral(DAVINCI_MUX_AEAW4, 1);
davinci_mux_peripheral(DAVINCI_MUX_VLSCREN, 1); davinci_mux_peripheral(DAVINCI_MUX_VLSCREN, 1);
davinci_mux_peripheral(DAVINCI_MUX_VLYNQEN, 1); davinci_mux_peripheral(DAVINCI_MUX_VLYNQEN, 1);
#endif
regval = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + PINMUX0); regval = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + PINMUX0);
printk(KERN_WARNING "Warning: MUX config for NAND: Set " \ printk(KERN_WARNING "Warning: MUX config for NAND: Set " \
......
...@@ -38,8 +38,7 @@ ...@@ -38,8 +38,7 @@
static int ths8200_attach_adapter(struct i2c_adapter *adapter); static int ths8200_attach_adapter(struct i2c_adapter *adapter);
static int ths8200_detach_client(struct i2c_client *client); static int ths8200_detach_client(struct i2c_client *client);
static int ths8200_detect_client(struct i2c_adapter *adapter, static int ths8200_detect_client(struct i2c_adapter *adapter, int address, int kind);
int address, int kind);
static inline int ths8200_write_value(u8 reg, u8 value); static inline int ths8200_write_value(u8 reg, u8 value);
static inline int ths8200_read_value(u8 reg); static inline int ths8200_read_value(u8 reg);
...@@ -56,8 +55,7 @@ static struct i2c_driver ths8200_driver = { ...@@ -56,8 +55,7 @@ static struct i2c_driver ths8200_driver = {
}; };
/* I2C Addresses to scan */ /* I2C Addresses to scan */
static unsigned short normal_i2c[] = { 0x20, \ static unsigned short normal_i2c[] = { 0x20, I2C_CLIENT_END };
I2C_CLIENT_END};
/* This makes all addr_data:s */ /* This makes all addr_data:s */
I2C_CLIENT_INSMOD; I2C_CLIENT_INSMOD;
...@@ -74,8 +72,7 @@ static inline int ths8200_write_value(u8 reg, u8 value) ...@@ -74,8 +72,7 @@ static inline int ths8200_write_value(u8 reg, u8 value)
{ {
int ret; int ret;
ret = i2c_smbus_write_byte_data(ths8200_client, ret = i2c_smbus_write_byte_data(ths8200_client, reg, value);
reg, value);
if (ret != 0) if (ret != 0)
DPRINTK("Write Error Address = %x\n", reg); DPRINTK("Write Error Address = %x\n", reg);
...@@ -100,8 +97,7 @@ static int ths8200_detach_client(struct i2c_client *client) ...@@ -100,8 +97,7 @@ static int ths8200_detach_client(struct i2c_client *client)
err = i2c_detach_client(client); err = i2c_detach_client(client);
if (err) { if (err) {
DPRINTK("Client deregistration failed, \ DPRINTK("Client deregistration failed, client not detached.\n");
client not detached.\n");
return err; return err;
} }
kfree(client); kfree(client);
...@@ -117,19 +113,17 @@ static int ths8200_detect_client(struct i2c_adapter *adapter, ...@@ -117,19 +113,17 @@ static int ths8200_detect_client(struct i2c_adapter *adapter,
FN_IN; FN_IN;
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA | if (!i2c_check_functionality(adapter,
I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_WRITE_BYTE)) { I2C_FUNC_SMBUS_WRITE_BYTE)) {
DPRINTK("Functinality check failed for %s \n", DPRINTK("Functinality check failed for %s \n", client_name);
client_name);
return err; return err;
} }
ths8200_client = kmalloc(sizeof(struct i2c_client), ths8200_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
GFP_KERNEL);
if (ths8200_client == NULL) { if (ths8200_client == NULL) {
err = -ENOMEM; err = -ENOMEM;
DPRINTK("Couldn't allocate memory for %s\n", DPRINTK("Couldn't allocate memory for %s\n", client_name);
client_name);
return err; return err;
} }
...@@ -156,7 +150,8 @@ int ths8200_set_480p_mode(void) ...@@ -156,7 +150,8 @@ int ths8200_set_480p_mode(void)
ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_RESET); ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_RESET);
/* take ths8200 out of reset and in normal operation mode */ /* take ths8200 out of reset and in normal operation mode */
ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_OUT_OF_RESET | ths8200_write_value(CHIP_CTL_REG,
CHIP_SOFTWARE_OUT_OF_RESET |
CHIP_LOW_FREQUENCY); CHIP_LOW_FREQUENCY);
/* place color space conversion control in reset state */ /* place color space conversion control in reset state */
...@@ -177,7 +172,8 @@ int ths8200_set_480p_mode(void) ...@@ -177,7 +172,8 @@ int ths8200_set_480p_mode(void)
CSC_PROTECTION_ON); CSC_PROTECTION_ON);
/* set YCx20 External Sync */ /* set YCx20 External Sync */
ths8200_write_value(DTG2_CNTL_REG, HS_IN_POSITIVE_POLARITY | ths8200_write_value(DTG2_CNTL_REG,
HS_IN_POSITIVE_POLARITY |
VS_IN_POSITIVE_POLARITY | VS_IN_POSITIVE_POLARITY |
HS_OUT_POSITIVE_POLARITY | HS_OUT_POSITIVE_POLARITY |
VS_OUT_POSITIVE_POLARITY); VS_OUT_POSITIVE_POLARITY);
...@@ -283,7 +279,8 @@ int ths8200_set_480p_mode(void) ...@@ -283,7 +279,8 @@ int ths8200_set_480p_mode(void)
ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_RESET); ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_RESET);
/* take ths8200 out of reset and in normal operation mode */ /* take ths8200 out of reset and in normal operation mode */
ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_OUT_OF_RESET | ths8200_write_value(CHIP_CTL_REG,
CHIP_SOFTWARE_OUT_OF_RESET |
CHIP_LOW_FREQUENCY); CHIP_LOW_FREQUENCY);
printk(KERN_INFO "THS8200 set video mode as 480p\n"); printk(KERN_INFO "THS8200 set video mode as 480p\n");
...@@ -319,7 +316,8 @@ int ths8200_set_720p_mode(void) ...@@ -319,7 +316,8 @@ int ths8200_set_720p_mode(void)
CSC_PROTECTION_ON); CSC_PROTECTION_ON);
/* set YCx20 External Sync */ /* set YCx20 External Sync */
ths8200_write_value(DTG2_CNTL_REG, HS_IN_POSITIVE_POLARITY | ths8200_write_value(DTG2_CNTL_REG,
HS_IN_POSITIVE_POLARITY |
VS_IN_POSITIVE_POLARITY | VS_IN_POSITIVE_POLARITY |
HS_OUT_POSITIVE_POLARITY | HS_OUT_POSITIVE_POLARITY |
VS_OUT_POSITIVE_POLARITY); VS_OUT_POSITIVE_POLARITY);
...@@ -436,11 +434,13 @@ int ths8200_set_1080i_mode(void) ...@@ -436,11 +434,13 @@ int ths8200_set_1080i_mode(void)
FN_IN; FN_IN;
/* place ths8200 in reset state */ /* place ths8200 in reset state */
ths8200_write_value(CHIP_CTL_REG,CHIP_SOFTWARE_RESET | ths8200_write_value(CHIP_CTL_REG,
CHIP_SOFTWARE_RESET |
CHIP_LOW_FREQUENCY); CHIP_LOW_FREQUENCY);
/* take ths8200 out of reset and in normal operation mode */ /* take ths8200 out of reset and in normal operation mode */
ths8200_write_value(CHIP_CTL_REG, CHIP_SOFTWARE_OUT_OF_RESET | ths8200_write_value(CHIP_CTL_REG,
CHIP_SOFTWARE_OUT_OF_RESET |
CHIP_LOW_FREQUENCY); CHIP_LOW_FREQUENCY);
/* place color space conversion control in reset state */ /* place color space conversion control in reset state */
...@@ -468,7 +468,8 @@ int ths8200_set_1080i_mode(void) ...@@ -468,7 +468,8 @@ int ths8200_set_1080i_mode(void)
ths8200_write_value(CSM_GY_CNTL_MULT_MSB_REG, 0x00); ths8200_write_value(CSM_GY_CNTL_MULT_MSB_REG, 0x00);
/* set YCx20 External Sync */ /* set YCx20 External Sync */
ths8200_write_value(DTG2_CNTL_REG, HS_IN_POSITIVE_POLARITY | ths8200_write_value(DTG2_CNTL_REG,
HS_IN_POSITIVE_POLARITY |
VS_IN_POSITIVE_POLARITY | VS_IN_POSITIVE_POLARITY |
HS_OUT_POSITIVE_POLARITY | HS_OUT_POSITIVE_POLARITY |
VS_OUT_POSITIVE_POLARITY | VS_OUT_POSITIVE_POLARITY |
...@@ -635,8 +636,7 @@ static __init int ths8200_init(void) ...@@ -635,8 +636,7 @@ static __init int ths8200_init(void)
FN_IN; FN_IN;
if (i2c_add_driver(&ths8200_driver)) { if (i2c_add_driver(&ths8200_driver)) {
DPRINTK("Driver registration failed, \ DPRINTK("Driver registration failed, module not inserted.\n");
module not inserted.\n");
return -ENODEV; return -ENODEV;
} }
......
This diff is collapsed.
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
#ifndef __DAVINCI_GPIO_H #ifndef __DAVINCI_GPIO_H
#define __DAVINCI_GPIO_H #define __DAVINCI_GPIO_H
#include <asm/io.h>
#include "hardware.h"
#include "io.h"
/* /*
* basic gpio routines * basic gpio routines
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment