Re: saDisplay + DM6467 showing black an white image in SD Display
Hi Vinayagam, I suppose that your customized MPEG-4 Decoder is xDAIS-xDM complaint, if yes than TI's application will run without any changes. I don't know much about codec interface for customized Codec's, however you can take reference of few doc's on net. http://wiki.davincidsp.com/index.php/TopTenCodecPackageCheckList#3._VISA_XDM_API_usage XDAIS Rules Guidelines: SPRU352 XDAIS API Reference: SPRU360 Regards, Deepika Vinayagam Mariappan wrote: Hi, I have checked with H264 Stream with D1 resolution using TI DM6467 Demo Application. Its working. But It doest work with our customized MPEG-4 Decoder. I am doubting only my codec interface Do you have simple codec interface using VIDEC2 using two output buffer? Please do help me to fix this issueThis is first time I am doing all this kind of interface so confusing me. Regards, Vinayagam M On Mon, Aug 10, 2009 at 4:02 PM, Deepika Makhija deepika.makh...@einfochips.com wrote: Hi Vinayagam, H264 sample streams are available on TI Extranet: https://www-a.ti.com/extranet/cm/product/dvevmsw/dspswext/general/dm355_dvevm.shtml Consider TI's decode application, file "dvsdk_demos_1_40_00_18/dm6467/decode/video.c" is used to set the decoder parameters, where Vdec2_Params_DEFAULT and Vdec2_DynamicParams_DEFAULT are used to set the default decoder parameters, whose value is mentioned in dmai module, you have to modify height/width of these as per your resolution. Same would be the case with "dvsdk_demos_1_40_00_18/dm6467/decode/display.c" where default display parameters are set with Display_Attrs_DM6467_VID_DEFAULT. Regards, Deepika Vinayagam Mariappan wrote: Hi, I have only H264 TI Codec Lib but I do not find H264 Stream for D1. Do you have any sample file? Please send me if you have one... Its confusing me to Integrate with our customized codec... As I know, I have to do minimal changes to get our customized codec to work with our TI Demo Application. Could you please me specific things to see? Do you have any idea which specific enum directly look into it...? Regards, Vinayagam M On Mon, Aug 3, 2009 at 1:40 PM, Deepika Makhija deepika.makh...@einfochips.com wrote: Hi, Nice to hear that your saDisplay is working now. "we are not getting video.But I get video data till App." Can you please describe in detail, up till which module you are getting correct output. I would suggest instead of integrating your decoder, first try to modify the application to work at D1 resolution with TI codecs, which are capable of decoding D1 resolution also, for that you would have to change few enums in the application. Once that path is clear than integrate your decoder. Regards, Deepika Vinayagam Mariappan wrote: Hi Deepika, I just made the saDisplay to work properly. Now I have to change the Decoder Application to work with our customized decoder which always give video out with D1 resolution... The TI Demo Application is for HD Display and I change that to work for SD Display. When I integrate our customized decoder with demo application, we are not getting video.But I get video data till App. Where will be the problem... Regards, Vinayagam M -- _ Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated.Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. _ -- Regards, Vinayagam M VeNMSOL Technologies, #7A, First Cross Street, Ganapathy Colony, Ekkaduthangal, Chennai - 600 032,India. Tel:+91-44-4353 0168;Mobile:+91-9445-019919 URL: www.venmsol.com "We make a living by what we get, we make a life by what we give...- Unknown " Email Scanned for Virus Dangerous Content by : www.CleanMailGateway.com
Re: saDisplay + DM6467 showing black an white image in SD Display
Hi, Our Codec is xDAIS-xDM Compliant so thats not trouble to get decoded data to Application. But we are doing some mistake on buffer assignment in compliant with VIDEC2. Please let me know, If you have some specific reference or sample for VIDEC2 Codec. Regards, Vinayagam M On Wed, Aug 12, 2009 at 3:11 PM, Deepika Makhija deepika.makh...@einfochips.com wrote: Hi Vinayagam, I suppose that your customized MPEG-4 Decoder is xDAIS-xDM complaint, if yes than TI's application will run without any changes. I don't know much about codec interface for customized Codec's, however you can take reference of few doc's on net. http://wiki.davincidsp.com/index.php/TopTenCodecPackageCheckList#3._VISA_XDM_API_usage XDAIS Rules Guidelines : SPRU352http://www-s.ti.com/sc/techlit/spru352 XDAIS API Reference : SPRU360 http://www-s.ti.com/sc/techlit/spru360 Regards, Deepika Vinayagam Mariappan wrote: Hi, I have checked with H264 Stream with D1 resolution using TI DM6467 Demo Application. Its working. But It doest work with our customized MPEG-4 Decoder. I am doubting only my codec interface Do you have simple codec interface using VIDEC2 using two output buffer? Please do help me to fix this issueThis is first time I am doing all this kind of interface so confusing me. Regards, Vinayagam M On Mon, Aug 10, 2009 at 4:02 PM, Deepika Makhija deepika.makh...@einfochips.com wrote: Hi Vinayagam, H264 sample streams are available on TI Extranet: https://www-a.ti.com/extranet/cm/product/dvevmsw/dspswext/general/dm355_dvevm.shtml Consider TI's decode application, file dvsdk_demos_1_40_00_18/dm6467/decode/video.c is used to set the decoder parameters, where Vdec2_Params_DEFAULT and Vdec2_DynamicParams_DEFAULT are used to set the default decoder parameters, whose value is mentioned in dmai module, you have to modify height/width of these as per your resolution. Same would be the case with dvsdk_demos_1_40_00_18/dm6467/decode/display.c where default display parameters are set with Display_Attrs_DM6467_VID_DEFAULT. Regards, Deepika Vinayagam Mariappan wrote: Hi, I have only H264 TI Codec Lib but I do not find H264 Stream for D1. Do you have any sample file? Please send me if you have one... Its confusing me to Integrate with our customized codec... As I know, I have to do minimal changes to get our customized codec to work with our TI Demo Application. Could you please me specific things to see? Do you have any idea which specific enum directly look into it...? Regards, Vinayagam M On Mon, Aug 3, 2009 at 1:40 PM, Deepika Makhija deepika.makh...@einfochips.com wrote: Hi, Nice to hear that your saDisplay is working now. we are not getting video.But I get video data till App. Can you please describe in detail, up till which module you are getting correct output. I would suggest instead of integrating your decoder, first try to modify the application to work at D1 resolution with TI codecs, which are capable of decoding D1 resolution also, for that you would have to change few enums in the application. Once that path is clear than integrate your decoder. Regards, Deepika Vinayagam Mariappan wrote: Hi Deepika, I just made the saDisplay to work properly. Now I have to change the Decoder Application to work with our customized decoder which always give video out with D1 resolution... The TI Demo Application is for HD Display and I change that to work for SD Display. When I integrate our customized decoder with demo application, we are not getting video.But I get video data till App. Where will be the problem... Regards, Vinayagam M -- _ Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated.Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. _ -- Regards, Vinayagam M VeNMSOL Technologies, #7A, First Cross Street, Ganapathy Colony, Ekkaduthangal, Chennai - 600 032,India. Tel:+91-44-4353 0168;Mobile:+91-9445-019919 URL: www.venmsol.com We make a living by what
usb error
Hello everybody ,where can i find a patch to solve the following errors when i insmod musb_hdrc.ko on DM6446 sb 1-1: khubd timed out on ep0in usb 1-1: device descriptor read/64, error -110 usb 1-1: khubd timed out on ep0in usb 1-1: device descriptor read/64, error -110 usb 1-1: new full speed USB device using musb_hdrc and address 3 usb 1-1: khubd timed out on ep0in usb 1-1: device descriptor read/64, error -110 usb 1-1: khubd timed out on ep0in Thanks a lot . 2009-08-12 黄守旺 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
RE: [PATCH] davinci: Add platform support for da850/omap-l138 GLCD
On Tue, Aug 11, 2009 at 19:08:24, Nori, Sekhar wrote: Sudhakar, On Wed, Aug 12, 2009 at 03:28:02, Rajashekhara, Sudhakar wrote: This patch adds platform support for the graphic display (Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- arch/arm/mach-davinci/board-da850-evm.c| 71 arch/arm/mach-davinci/da850.c | 42 arch/arm/mach-davinci/devices-da8xx.c | 59 +++ arch/arm/mach-davinci/include/mach/da8xx.h |3 + arch/arm/mach-davinci/include/mach/mux.h | 26 ++ 5 files changed, 201 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index d989346..45575e5 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -17,6 +17,8 @@ #include linux/console.h #include linux/i2c.h #include linux/i2c/at24.h +#include linux/gpio.h +#include linux/delay.h #include asm/mach-types.h #include asm/mach/arch.h @@ -25,6 +27,7 @@ #include mach/irqs.h #include mach/cp_intc.h #include mach/da8xx.h +#include mach/psc.h #define DA850_EVM_PHY_MASK 0x1 #define DA850_EVM_MDIO_FREQUENCY 220 /* PHY bus frequency */ @@ -38,6 +41,59 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +int da850_lcd_hw_init(void) This should be static? Yes, this function can be static. +{ + /* GPIO 2[15] is used for LCD back light - 16 * 2 + 15 = 47 */ + int bl_gpio_num = 47; + + /* GPIO 8[10] is used for LCD power - 16 * 8 + 10 = 138 */ + int pwr_gpio_num = 138; These could probably be #defines instead of variables. I'll define the GPIO pin numbers as macros. + int status; + + status = gpio_request(bl_gpio_num, lcd bl\n); + if (status 0) + return status; + + status = gpio_request(pwr_gpio_num, lcd pwr\n); + if (status 0) + return status; We are missing gpio_free of back light GPIO here. I'll take care of this. + + gpio_direction_output(bl_gpio_num, 0); + gpio_direction_output(pwr_gpio_num, 0); + + /* disable lcd backlight */ + gpio_set_value(bl_gpio_num, 0); + + /* disable lcd power */ + gpio_set_value(pwr_gpio_num, 0); + + /* wait for sometime */ + mdelay(3); Can you explain the reasoning behind the delay in the comment? I found out during testing that these delays are not required. I'll remove them in my next version. + + /* disable lcdc */ + davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 1, DA8XX_LPSC1_LCDC, 0); Hmm, why is this needed? Hopefully the LCD clock has not been enabled by this time. Same as previous. + + /* wait for sometime */ + mdelay(1); Some explanation required here too. Same here.. [] +static struct lcd_ctrl_config lcd_cfg = { + disp_panel,/* p_disp_panel */ + .ac_bias= 255, /* ac bias*/ + .ac_bias_intrpt = 0,/* ac bias intrpt */ + .dma_burst_sz = 16, /* dma_burst_sz */ + .bpp= 16, /* bpp*/ + .fdd= 255, /* fdd*/ + .tft_alt_mode = 0,/* tft_alt_mode */ + .stn_565_mode = 0,/* stn_565_mode */ + .mono_8bit_mode = 0,/* mono_8bit_mode*/ + .invert_line_clock = 1,/* invert_line_clock */ + .invert_frm_clock = 1,/* invert_frm_clock */ + .sync_edge = 0,/* sync_edge */ + .sync_ctrl = 1,/* sync_ctrl */ + .raster_order = 0,/* raster_order */ +}; Comments at end of each line are not required. I'll remove these comments. Thanks for your review. I'll re-submit the patch after addressing the comments. Regards, Sudhakar ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
tiwlan wifi auto configuration
Hi, I am able to configure Wifi only from command line either for adhoc or Infrastructure I am eager to know how to configure Wireless LAN on System boot. Both ADHOC or Infrastructure. Writing those commands in script file doesnt work.I configured in tiwlan.ini also for adhoc but no change. Suggest me the way or is there any reference for configuring tiwlan on system boot for adhoc and infrastructure. Note:My driver doesnt have wlan_supplicant and wlan_loader ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
evm DM365 access to EEPROM and Keypad
Hi, I found no documentation for accessing the eeprom on the evmdm365 - DM365. The device is /dev/mtd5. I would like to post application code for working with EEPROM: // - // write params to EEPROM #define EEPROM_FILE_NAME /dev/mtd5 // /opt/http/cam_params.txt #define EEPROM_PARAMS_START_ADDR 0x40 Write_Param_EEPROM() { FILE* F=fopen(EEPROM_FILE_NAME,w); if (!F) { printf(Read_Params_EEPROM - Error opening file\n); return -1; } if (fseek(F,EEPROM_PARAMS_START_ADDR,SEEK_SET)) { printf(Read_Params_EEPROM - Error seeking file\n); fclose(F); return -1; } // save all params to the file // store parameter self fprintf(F,This string will be stored in eeprom.); fclose(F); } // - Also working with keypad on evmdm365 can be handled with this code: // #define KEY_CODE_STOP 12 static int buttons_fd=0; #define KEYBOARD_FILE_NAME /dev/input/event0 static void HandleButtons() { int rb; int i; #define MAX_EVENTS 1 struct input_event ev[MAX_EVENTS]; if (!buttons_fd) { printf(SetupApply HandleButtons - Error zero handle KEYBOARD_FILE_NAME \n); return; } rb = read(buttons_fd, ev, sizeof(ev)); if (rb1) return; if (rb (int) sizeof(struct input_event)) { printf(HandleButtons: short read\n); return; } for (i = 0; i (int) (rb / sizeof(struct input_event)); i++) { if (EV_KEY == ev[i].type) { printf(HandleButtons i %d time %ld.%06ld , i, ev[i].time.tv_sec, ev[i].time.tv_usec); printf(HandleButtons type %d code %d value %d\n, ev[i].type, ev[i].code, ev[i].value); if (ev[i].value==1) { switch (ev[i].code) { case KEY_CODE_STOP: printf(Button stop was pressed\n); break; } } } } } // static void StartButtonsHandler() { buttons_fd = open(KEYBOARD_FILE_NAME, 0); // O_NONBLOCK if (buttons_fd) { printf(SetupApply InitButtons - OK KEYBOARD_FILE_NAME \n); } else { printf(SetupApply InitButtons - Error opening handle KEYBOARD_FILE_NAME \n); return; } while (1) { HandleButtons(); usleep(100); } } // Best regards, Juraj ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Direct SPI access on dm365 / dm355 using SPIDEV
Hi, Did someone successed to work with SPI from application? E.g. Use /dev/spi3 for controlling additional CPU from shell or with suggested spidev.c (linux/documentation/spi/spidev). I use: mv_linux-2.6.18_pro500 and dvsdk_2_10_00_17 Here are some threads about it, but no one is finished with success: http://e2e.ti.com/forums/t/7081.aspx http://n2.nabble.com/how-can-i-use-spi-in-dm355--td3131727.html http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg13191.html Thanx Juraj ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD
This patch adds platform support for the graphic display (Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- Since the previous version, following are the modifications: 1. Defined the macros for the LCD back light and LCD power GPIO pins. 2. Made da850_lcd_hw_init() function static. 3. Added gpio_free() for 1st GPIO pin, if gpio_request for the 2nd GPIO pin fails. 4. Removed un-necessary mdelays from da850_lcd_hw_init() function. 5. Also removed LPSC disable/enable sequence from da850_lcd_hw_init() function. 6. Removed the comments for the members of lcd_ctrl_config structure. arch/arm/mach-davinci/board-da850-evm.c| 58 +++ arch/arm/mach-davinci/da850.c | 42 arch/arm/mach-davinci/devices-da8xx.c | 59 arch/arm/mach-davinci/include/mach/da8xx.h |3 + arch/arm/mach-davinci/include/mach/mux.h | 26 5 files changed, 188 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index d989346..b05b7f5 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -17,6 +17,8 @@ #include linux/console.h #include linux/i2c.h #include linux/i2c/at24.h +#include linux/gpio.h +#include linux/delay.h #include asm/mach-types.h #include asm/mach/arch.h @@ -25,10 +27,16 @@ #include mach/irqs.h #include mach/cp_intc.h #include mach/da8xx.h +#include mach/psc.h #define DA850_EVM_PHY_MASK 0x1 #define DA850_EVM_MDIO_FREQUENCY 220 /* PHY bus frequency */ +/* GPIO 2[15] is used for LCD Back light - 16 * 2 + 15 = 47*/ +#define DA850_LCD_BL_PIN 47 +/* GPIO 8[10] is used for LCD Power - 16 * 8 + 10 = 138 */ +#define DA850_LCD_PWR_PIN 138 + static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { .bus_freq = 100, /* kHz */ .bus_delay = 0,/* usec */ @@ -38,6 +46,41 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +static int da850_lcd_hw_init(void) +{ + int status; + + status = gpio_request(DA850_LCD_BL_PIN, lcd bl\n); + if (status 0) + return status; + + status = gpio_request(DA850_LCD_PWR_PIN, lcd pwr\n); + if (status 0) { + gpio_free(DA850_LCD_BL_PIN); + return status; + } + + gpio_direction_output(DA850_LCD_BL_PIN, 0); + gpio_direction_output(DA850_LCD_PWR_PIN, 0); + + /* disable lcd backlight */ + gpio_set_value(DA850_LCD_BL_PIN, 0); + + /* disable lcd power */ + gpio_set_value(DA850_LCD_PWR_PIN, 0); + + /* enable lcd power */ + gpio_set_value(DA850_LCD_PWR_PIN, 1); + + /* enable lcd backlight */ + gpio_set_value(DA850_LCD_BL_PIN, 1); + + gpio_free(DA850_LCD_BL_PIN); + gpio_free(DA850_LCD_PWR_PIN); + + return 0; +} + static __init void da850_evm_init(void) { struct davinci_soc_info *soc_info = davinci_soc_info; @@ -86,6 +129,21 @@ static __init void da850_evm_init(void) */ __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); + + ret = da8xx_pinmux_setup(da850_lcdcntl_pins); + if (ret) + pr_warning(da850_evm_init: lcdcntl mux setup failed: %d\n, + ret); + + ret = da850_lcd_hw_init(); + if (ret) + pr_warning(da850_evm_init: lcd initialization failed: %d\n, + ret); + + ret = da8xx_register_lcdc(); + if (ret) + pr_warning(da850_evm_init: lcdc registration failed: %d\n, + ret); } #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index c5efc51..69acb6e 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -290,6 +290,13 @@ static struct clk emac_clk = { .psc_ctlr = 1, }; +static struct clk lcdc_clk = { + .name = lcdc, + .parent = pll0_sysclk2, + .lpsc = DA8XX_LPSC1_LCDC, + .psc_ctlr = 1, +}; + static struct davinci_clk da850_clks[] = { CLK(NULL, ref, ref_clk), CLK(NULL, pll0, pll0_clk), @@ -327,6 +334,7 @@ static struct davinci_clk da850_clks[] = { CLK(NULL, arm, arm_clk), CLK(NULL, rmii, rmii_clk), CLK(davinci_emac.1, NULL, emac_clk), + CLK(da8xx_lcdc.0, NULL, lcdc_clk), CLK(NULL, NULL, NULL), }; @@ -373,6 +381,30 @@ static const struct mux_config da850_pins[] = {
[PATCH v2] davinci: Add NOR flash support for da850/omap-l138
This patch adds platform data for the 8MB NOR flash found on da850/omap-l138 EVM. Both NOR and NAND can co-exist on da850/omap-l138 as they are using different chip selects. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- Since the previous version, EMA_BA_0 pin has been removed from the mux table as this pin is not being used on DA850/OMAP-L138 EVM for NOR. This patch depends on the following patches which I have submitted to davinci git: [PATCH v2] davinci: Configure MDIO pins for EMAC [PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD [PATCH v2] davinci: Add MMC/SD support for da850/omap-l138 [PATCH v2] davinci: Add NAND flash support for DA850/OMAP-L138 arch/arm/mach-davinci/board-da850-evm.c| 60 arch/arm/mach-davinci/da850.c | 50 +++ arch/arm/mach-davinci/include/mach/da8xx.h |2 + arch/arm/mach-davinci/include/mach/mux.h | 34 4 files changed, 146 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b879cc5..6087458 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -23,6 +23,7 @@ #include linux/mtd/mtd.h #include linux/mtd/nand.h #include linux/mtd/partitions.h +#include linux/mtd/physmap.h #include asm/mach-types.h #include asm/mach/arch.h @@ -47,6 +48,41 @@ /* GPIO 4[1] is used for MMC/SD WP - 16 * 4 + 1 = 65 */ #define DA850_MMCSD_WP_PIN 65 +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) +static struct mtd_partition da850_evm_norflash_partition[] = { + { + .name = NOR filesystem, + .offset = 0, + .size = MTDPART_SIZ_FULL, + .mask_flags = 0, + }, +}; + +static struct physmap_flash_data da850_evm_norflash_data = { + .width = 2, + .parts = da850_evm_norflash_partition, + .nr_parts = ARRAY_SIZE(da850_evm_norflash_partition), +}; + +static struct resource da850_evm_norflash_resource[] = { + { + .start = DA8XX_AEMIF_CS2_BASE, + .end= DA8XX_AEMIF_CS2_BASE + SZ_32M - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device da850_evm_norflash_device = { + .name = physmap-flash, + .id = 0, + .dev= { + .platform_data = da850_evm_norflash_data, + }, + .num_resources = 1, + .resource = da850_evm_norflash_resource, +}; +#endif + #if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash * (128K blocks). It may be used instead of the (default) SPI flash @@ -130,6 +166,9 @@ static struct platform_device *da850_evm_devices[] __initdata = { #if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) da850_evm_nandflash_device, #endif +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) + da850_evm_norflash_device, +#endif }; #if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) @@ -192,6 +231,18 @@ static int da850_lcd_hw_init(void) return 0; } +static void __init da850_evm_init_nor(void) +{ + void __iomem *aemif_addr; + + aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K - 1); + + /* Configure data bus width of CS2 to 16 bit */ + __raw_writel(1, aemif_addr + 0x10); + + iounmap(aemif_addr); +} + static __init void da850_evm_init(void) { struct davinci_soc_info *soc_info = davinci_soc_info; @@ -204,6 +255,15 @@ static __init void da850_evm_init(void) ret); #endif +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) + ret = da8xx_pinmux_setup(da850_nor_pins); + if (ret) + pr_warning(da850_evm_init: nor mux setup failed: %d\n, + ret); + + da850_evm_init_nor(); +#endif + platform_add_devices(da850_evm_devices, ARRAY_SIZE(da850_evm_devices)); diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 4923f13..2b59e93 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -439,6 +439,40 @@ static const struct mux_config da850_pins[] = { MUX_CFG(DA850, NEMA_CS_4, 7, 8, 15, 1, false) MUX_CFG(DA850, NEMA_WE, 7, 16, 15, 1, false) MUX_CFG(DA850, NEMA_OE, 7, 20, 15, 1, false) + MUX_CFG(DA850, EMA_A_0, 12, 28, 15, 1, false) + MUX_CFG(DA850, EMA_A_3, 12, 16, 15, 1, false) + MUX_CFG(DA850, EMA_A_4, 12, 12, 15, 1,
[PATCH v2] davinci: Add MMC/SD support for da850/omap-l138
There are two instances of MMC/SD on da850/omap-l138. Connector for the first instance is available on the EVM. This patch adds support for this instance. This patch also adds support for card detect and write protect switches on da850/omap-l138 EVM. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- Since the previous version, following are the modifications: 1. Defined the macros for the GPIO pins. 2. Moved calls to gpio_request() and gpio_direction_input() to da850_evm_init() function. 3. Added the GPIO pins used for Card detect and Write protect features to the mux table. This patch depends on the following patches which I have submitted to davinci git: [PATCH v2] davinci: Configure MDIO pins for EMAC [PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD arch/arm/mach-davinci/board-da850-evm.c| 54 arch/arm/mach-davinci/da850.c | 23 arch/arm/mach-davinci/devices-da8xx.c | 38 +++ arch/arm/mach-davinci/include/mach/da8xx.h |4 ++ arch/arm/mach-davinci/include/mach/mux.h | 10 + 5 files changed, 129 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b05b7f5..97251c3 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -37,6 +37,11 @@ /* GPIO 8[10] is used for LCD Power - 16 * 8 + 10 = 138 */ #define DA850_LCD_PWR_PIN 138 +/* GPIO 4[0] is used for MMC/SD CD - 16 * 4 + 0 = 64 */ +#define DA850_MMCSD_CD_PIN 64 +/* GPIO 4[1] is used for MMC/SD WP - 16 * 4 + 1 = 65 */ +#define DA850_MMCSD_WP_PIN 65 + static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { .bus_freq = 100, /* kHz */ .bus_delay = 0,/* usec */ @@ -46,6 +51,31 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) +static int da850_evm_mmc_get_ro(int index) +{ + int val; + + val = gpio_get_value(DA850_MMCSD_WP_PIN); + return val; +} + +static int da850_evm_mmc_get_cd(int index) +{ + int val; + + val = gpio_get_value(DA850_MMCSD_CD_PIN); + return !val; +} + +static struct davinci_mmc_config da850_mmc_config = { + .get_ro = da850_evm_mmc_get_ro, + .get_cd = da850_evm_mmc_get_cd, + .wires = 4, + .version= MMC_CTLR_VERSION_2, +}; +#endif + static int da850_lcd_hw_init(void) { int status; @@ -120,6 +150,30 @@ static __init void da850_evm_init(void) pr_warning(da830_evm_init: watchdog registration failed: %d\n, ret); +#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) + ret = da8xx_pinmux_setup(da850_mmcsd0_pins); + if (ret) + pr_warning(da850_evm_init: mmcsd0 mux setup failed: %d\n, + ret); + + ret = gpio_request(DA850_MMCSD_CD_PIN, MMC CD\n); + if (ret) + pr_warning(da850_evm_init: can not open GPIO %d\n, + DA850_MMCSD_CD_PIN); + gpio_direction_input(DA850_MMCSD_CD_PIN); + + ret = gpio_request(DA850_MMCSD_WP_PIN, MMC WP\n); + if (ret) + pr_warning(da850_evm_init: can not open GPIO %d\n, + DA850_MMCSD_WP_PIN); + gpio_direction_input(DA850_MMCSD_WP_PIN); + + ret = da8xx_register_mmcsd0(da850_mmc_config); + if (ret) + pr_warning(da850_evm_init: mmcsd0 registration failed: %d\n, + ret); +#endif + davinci_serial_init(da850_evm_uart_config); /* diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 69acb6e..62e0f2f 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -297,6 +297,12 @@ static struct clk lcdc_clk = { .psc_ctlr = 1, }; +static struct clk mmcsd_clk = { + .name = mmcsd, + .parent = pll0_sysclk2, + .lpsc = DA8XX_LPSC0_MMC_SD, +}; + static struct davinci_clk da850_clks[] = { CLK(NULL, ref, ref_clk), CLK(NULL, pll0, pll0_clk), @@ -335,6 +341,7 @@ static struct davinci_clk da850_clks[] = { CLK(NULL, rmii, rmii_clk), CLK(davinci_emac.1, NULL, emac_clk), CLK(da8xx_lcdc.0, NULL, lcdc_clk), + CLK(davinci_mmc.0,NULL, mmcsd_clk), CLK(NULL, NULL, NULL), }; @@ -402,9 +409,18 @@ static const struct mux_config da850_pins[] = { MUX_CFG(DA850, LCD_HSYNC, 19, 0, 15, 2, false) MUX_CFG(DA850, LCD_VSYNC, 19, 4,
[PATCH v2] davinci: Add NAND flash support for DA850/OMAP-L138
This patch adds platform data for the 512MB NAND Flash found on DA850/OMAP-L138 EVM. Currently it supports only 1-bit ECC. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- No changes from the previous version, except that the patch has been modified to apply on master branch. This patch depends on the following patches which I have submitted to davinci git: [PATCH v2] davinci: Configure MDIO pins for EMAC [PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD [PATCH v2] davinci: Add MMC/SD support for da850/omap-l138 arch/arm/mach-davinci/board-da850-evm.c| 91 arch/arm/mach-davinci/da850.c | 31 ++ arch/arm/mach-davinci/include/mach/da8xx.h |3 + arch/arm/mach-davinci/include/mach/mux.h | 16 + 4 files changed, 141 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 97251c3..c42795a 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -19,6 +19,10 @@ #include linux/i2c/at24.h #include linux/gpio.h #include linux/delay.h +#include linux/platform_device.h +#include linux/mtd/mtd.h +#include linux/mtd/nand.h +#include linux/mtd/partitions.h #include asm/mach-types.h #include asm/mach/arch.h @@ -28,6 +32,7 @@ #include mach/cp_intc.h #include mach/da8xx.h #include mach/psc.h +#include mach/nand.h #define DA850_EVM_PHY_MASK 0x1 #define DA850_EVM_MDIO_FREQUENCY 220 /* PHY bus frequency */ @@ -42,6 +47,76 @@ /* GPIO 4[1] is used for MMC/SD WP - 16 * 4 + 1 = 65 */ #define DA850_MMCSD_WP_PIN 65 +#if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) +/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash + * (128K blocks). It may be used instead of the (default) SPI flash + * to boot, using TI's tools to install the secondary boot loader + * (UBL) and U-Boot. + */ +struct mtd_partition da850_evm_nandflash_partition[] = { + { + .name = u-boot env, + .offset = 0, + .size = SZ_128K, + .mask_flags = MTD_WRITEABLE, +}, + { + .name = UBL, + .offset = MTDPART_OFS_APPEND, + .size = SZ_128K, + .mask_flags = MTD_WRITEABLE, + }, + { + .name = u-boot, + .offset = MTDPART_OFS_APPEND, + .size = 4 * SZ_128K, + .mask_flags = MTD_WRITEABLE, + }, + { + .name = kernel, + .offset = 0x20, + .size = SZ_2M, + .mask_flags = 0, + }, + { + .name = filesystem, + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + .mask_flags = 0, + }, +}; + +static struct davinci_nand_pdata da850_evm_nandflash_data = { + .parts = da850_evm_nandflash_partition, + .nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition), + .ecc_mode = NAND_ECC_HW, + .options= NAND_USE_FLASH_BBT, +}; + +static struct resource da850_evm_nandflash_resource[] = { + { + .start = DA8XX_AEMIF_CS3_BASE, + .end= DA8XX_AEMIF_CS3_BASE + SZ_512K + 2 * SZ_1K - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = DA8XX_AEMIF_CTL_BASE, + .end= DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device da850_evm_nandflash_device = { + .name = davinci_nand, + .id = 1, + .dev= { + .platform_data = da850_evm_nandflash_data, + }, + .num_resources = ARRAY_SIZE(da850_evm_nandflash_resource), + .resource = da850_evm_nandflash_resource, +}; +#endif + static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { .bus_freq = 100, /* kHz */ .bus_delay = 0,/* usec */ @@ -51,6 +126,12 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +static struct platform_device *da850_evm_devices[] __initdata = { +#if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) + da850_evm_nandflash_device, +#endif +}; + #if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) static int da850_evm_mmc_get_ro(int index) { @@ -116,6 +197,16 @@ static __init void da850_evm_init(void) struct davinci_soc_info *soc_info = davinci_soc_info; int ret; +#if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) + ret =
Re: tiwlan wifi auto configuration
In which script u added commands ? It is possible to to this with init script (rcS). --- On Wed, 12/8/09, kirthika varadarajan kirthikai...@gmail.com wrote: From: kirthika varadarajan kirthikai...@gmail.com Subject: tiwlan wifi auto configuration To: omkar savagaonkar omkar...@yahoo.co.in, Davinci-linux-open-source@linux.davincidsp.com davinci-linux-open-source@linux.davincidsp.com Date: Wednesday, 12 August, 2009, 3:56 PM Hi, I am able to configure Wifi only from command line either for adhoc or Infrastructure I am eager to know how to configure Wireless LAN on System boot. Both ADHOC or Infrastructure. Writing those commands in script file doesnt work.I configured in tiwlan.ini also for adhoc but no change. Suggest me the way or is there any reference for configuring tiwlan on system boot for adhoc and infrastructure. Note:My driver doesnt have wlan_supplicant and wlan_loader Send free SMS to your Friends on Mobile from your Yahoo! Messenger.. Download Now! http://messenger.yahoo.com/download.php___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH v5] davinci: fb: Frame Buffer driver for TI DA8xx/OMAP-L1xx
Sudhakar Rajashekhara sudhakar@ti.com writes: On Tue, Aug 11, 2009 at 05:04:43, Kevin Hilman wrote: [ distribution trimmed to Davinci only. ] Sudhakar Rajashekhara sudhakar@ti.com writes: Adds LCD controller (LCDC) driver for TI's DA8xx/OMAP-L1xx architecture. LCDC specifications can be found at http://www.ti.com/litv/pdf/sprufm0a. LCDC on DA8xx consists of two independent controllers, the Raster Controller and the LCD Interface Display Driver (LIDD) controller. LIDD further supports character and graphic displays. This patch adds support for the graphic display (Sharp LQ035Q3DG01) found on the DA830 based EVM. The EVM details can be found at: http://support.spectrumdigital.com/boards/dskda830/revc/. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com Signed-off-by: Pavel Kiryukhin pkiryuk...@ru.mvista.com Signed-off-by: Steve Chen sc...@mvista.com Acked-by: Krzysztof Helt krzysztof...@wp.pl As of 06 Aug, looks like Andrew has this in -mm. Pulling into DaVinci git while awaiting merge. Kevin, This pull has resulted only in updating the drivers/video/Kconfig file and modifications/additions to other files is missing. Can you please verify this? You're correct. My fault. Pushing full version shortly. Kevin ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH] davinci: Correct the number of GPIO pins for da850/omap-l138
Sudhakar Rajashekhara sudhakar@ti.com writes: DA850/OMAP-L138 has 144 pins configurable as GPIO, but currently this has been configured as 128. This patch corrects it. Also, this patch adds the base address for GPIO pins greater than 128. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com Looks fine, thanks. Pusing today. Kevin --- arch/arm/mach-davinci/da850.c |2 +- arch/arm/mach-davinci/include/mach/gpio.h |2 ++ arch/arm/mach-davinci/include/mach/irqs.h |4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 22205a3..c5efc51 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -623,7 +623,7 @@ static struct davinci_soc_info davinci_soc_info_da850 = { .intc_irq_num = DA850_N_CP_INTC_IRQ, .timer_info = da850_timer_info, .gpio_base = IO_ADDRESS(DA8XX_GPIO_BASE), - .gpio_num = 128, + .gpio_num = 144, .gpio_irq = IRQ_DA8XX_GPIO0, .serial_dev = da8xx_serial_device, .emac_pdata = da8xx_emac_pdata, diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h index ebcc29b..4f032b3 100644 --- a/arch/arm/mach-davinci/include/mach/gpio.h +++ b/arch/arm/mach-davinci/include/mach/gpio.h @@ -78,6 +78,8 @@ __gpio_to_controller(unsigned gpio) ptr = base + 0x60; else if (gpio 32 * 4) ptr = base + 0x88; + else if (gpio 32 * 5) + ptr = base + 0xb0; else ptr = NULL; return ptr; diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h index 6047c2d..7f755cc 100644 --- a/arch/arm/mach-davinci/include/mach/irqs.h +++ b/arch/arm/mach-davinci/include/mach/irqs.h @@ -397,8 +397,8 @@ #define DA850_N_CP_INTC_IRQ 101 -/* da830/da850 currently has the most gpio pins (128) */ -#define DAVINCI_N_GPIO 128 +/* da850 currently has the most gpio pins (144) */ +#define DAVINCI_N_GPIO 144 /* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */ #define NR_IRQS (DA850_N_CP_INTC_IRQ + DAVINCI_N_GPIO) -- 1.5.6 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH v2] davinci: Configure MDIO pins for EMAC
Sudhakar Rajashekhara sudhakar@ti.com writes: Earlier patch which adds EMAC support for da850/omap-l138 was not configuring the MDIO pins. Ethernet was working fine with the earlier patch, because the MDIO pins were configured from the boot loader. This patch removes that dependency. Also, this patch populates a member in the emac clk structure to say that EMAC LPSC sits on controller 1. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- No changes from the previous version, except that the patch has been modified to apply on master branch. Thanks, pushing today. Kevin arch/arm/mach-davinci/da850.c|6 +- arch/arm/mach-davinci/include/mach/mux.h |2 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 4a43ae2..22205a3 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -287,6 +287,7 @@ static struct clk emac_clk = { .name = emac, .parent = pll0_sysclk4, .lpsc = DA8XX_LPSC1_CPGMAC, + .psc_ctlr = 1, }; static struct davinci_clk da850_clks[] = { @@ -370,6 +371,8 @@ static const struct mux_config da850_pins[] = { MUX_CFG(DA850, MII_RXD_2, 3, 20, 15, 8, false) MUX_CFG(DA850, MII_RXD_1, 3, 24, 15, 8, false) MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false) + MUX_CFG(DA850, MDIO_CLK,4, 0, 15, 8, false) + MUX_CFG(DA850, MDIO_D, 4, 4, 15, 8, false) #endif }; @@ -402,7 +405,8 @@ const short da850_cpgmac_pins[] __initdata = { DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3, DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER, DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3, - DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, + DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, DA850_MDIO_CLK, + DA850_MDIO_D, -1 }; diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index a676b2f..8676680 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h @@ -748,6 +748,8 @@ enum davinci_da850_index { DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, + DA850_MDIO_CLK, + DA850_MDIO_D, }; #ifdef CONFIG_DAVINCI_MUX -- 1.5.6 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD
Sudhakar Rajashekhara sudhakar@ti.com writes: This patch adds platform support for the graphic display (Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- Since the previous version, following are the modifications: 1. Defined the macros for the LCD back light and LCD power GPIO pins. 2. Made da850_lcd_hw_init() function static. 3. Added gpio_free() for 1st GPIO pin, if gpio_request for the 2nd GPIO pin fails. 4. Removed un-necessary mdelays from da850_lcd_hw_init() function. 5. Also removed LPSC disable/enable sequence from da850_lcd_hw_init() function. 6. Removed the comments for the members of lcd_ctrl_config structure. arch/arm/mach-davinci/board-da850-evm.c| 58 +++ arch/arm/mach-davinci/da850.c | 42 arch/arm/mach-davinci/devices-da8xx.c | 59 arch/arm/mach-davinci/include/mach/da8xx.h |3 + arch/arm/mach-davinci/include/mach/mux.h | 26 5 files changed, 188 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index d989346..b05b7f5 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -17,6 +17,8 @@ #include linux/console.h #include linux/i2c.h #include linux/i2c/at24.h +#include linux/gpio.h +#include linux/delay.h #include asm/mach-types.h #include asm/mach/arch.h @@ -25,10 +27,16 @@ #include mach/irqs.h #include mach/cp_intc.h #include mach/da8xx.h +#include mach/psc.h #define DA850_EVM_PHY_MASK 0x1 #define DA850_EVM_MDIO_FREQUENCY 220 /* PHY bus frequency */ +/* GPIO 2[15] is used for LCD Back light - 16 * 2 + 15 = 47*/ +#define DA850_LCD_BL_PIN 47 +/* GPIO 8[10] is used for LCD Power - 16 * 8 + 10 = 138 */ +#define DA850_LCD_PWR_PIN138 + static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { .bus_freq = 100, /* kHz */ .bus_delay = 0,/* usec */ @@ -38,6 +46,41 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +static int da850_lcd_hw_init(void) +{ + int status; + + status = gpio_request(DA850_LCD_BL_PIN, lcd bl\n); + if (status 0) + return status; + + status = gpio_request(DA850_LCD_PWR_PIN, lcd pwr\n); + if (status 0) { + gpio_free(DA850_LCD_BL_PIN); + return status; + } + + gpio_direction_output(DA850_LCD_BL_PIN, 0); + gpio_direction_output(DA850_LCD_PWR_PIN, 0); + + /* disable lcd backlight */ + gpio_set_value(DA850_LCD_BL_PIN, 0); + + /* disable lcd power */ + gpio_set_value(DA850_LCD_PWR_PIN, 0); + + /* enable lcd power */ + gpio_set_value(DA850_LCD_PWR_PIN, 1); + + /* enable lcd backlight */ + gpio_set_value(DA850_LCD_BL_PIN, 1); + + gpio_free(DA850_LCD_BL_PIN); + gpio_free(DA850_LCD_PWR_PIN); Do you really want to free these and allow other potential users to change the direction/value? Since this board code, I suspect you want to request and hold the GPIO lines. This also would allow the use of the GPIO sysfs interface to toggle power and backlight for debug. Kevin + return 0; +} + static __init void da850_evm_init(void) { struct davinci_soc_info *soc_info = davinci_soc_info; @@ -86,6 +129,21 @@ static __init void da850_evm_init(void) */ __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); + + ret = da8xx_pinmux_setup(da850_lcdcntl_pins); + if (ret) + pr_warning(da850_evm_init: lcdcntl mux setup failed: %d\n, + ret); + + ret = da850_lcd_hw_init(); + if (ret) + pr_warning(da850_evm_init: lcd initialization failed: %d\n, + ret); + + ret = da8xx_register_lcdc(); + if (ret) + pr_warning(da850_evm_init: lcdc registration failed: %d\n, + ret); } #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index c5efc51..69acb6e 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -290,6 +290,13 @@ static struct clk emac_clk = { .psc_ctlr = 1, }; +static struct clk lcdc_clk = { + .name = lcdc, + .parent = pll0_sysclk2, + .lpsc = DA8XX_LPSC1_LCDC, + .psc_ctlr = 1, +}; + static struct davinci_clk da850_clks[] = { CLK(NULL, ref, ref_clk), CLK(NULL, pll0, pll0_clk), @@ -327,6 +334,7 @@ static struct davinci_clk da850_clks[] = {
Re: [PATCH v2] davinci: Add MMC/SD support for da850/omap-l138
Sudhakar Rajashekhara sudhakar@ti.com writes: There are two instances of MMC/SD on da850/omap-l138. Connector for the first instance is available on the EVM. This patch adds support for this instance. This patch also adds support for card detect and write protect switches on da850/omap-l138 EVM. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- Since the previous version, following are the modifications: 1. Defined the macros for the GPIO pins. 2. Moved calls to gpio_request() and gpio_direction_input() to da850_evm_init() function. 3. Added the GPIO pins used for Card detect and Write protect features to the mux table. This patch depends on the following patches which I have submitted to davinci git: [PATCH v2] davinci: Configure MDIO pins for EMAC [PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD arch/arm/mach-davinci/board-da850-evm.c| 54 arch/arm/mach-davinci/da850.c | 23 arch/arm/mach-davinci/devices-da8xx.c | 38 +++ arch/arm/mach-davinci/include/mach/da8xx.h |4 ++ arch/arm/mach-davinci/include/mach/mux.h | 10 + 5 files changed, 129 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b05b7f5..97251c3 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -37,6 +37,11 @@ /* GPIO 8[10] is used for LCD Power - 16 * 8 + 10 = 138 */ #define DA850_LCD_PWR_PIN138 +/* GPIO 4[0] is used for MMC/SD CD - 16 * 4 + 0 = 64 */ +#define DA850_MMCSD_CD_PIN 64 +/* GPIO 4[1] is used for MMC/SD WP - 16 * 4 + 1 = 65 */ +#define DA850_MMCSD_WP_PIN 65 + How about creating a macro in mach/gpio.h that takes a bank number and a GPIO number and returns (16 * bank + gpio). That way you don't have to keep adding comments for these. Then use the macro for these as well as in the GLCD patch. static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { .bus_freq = 100, /* kHz */ .bus_delay = 0,/* usec */ @@ -46,6 +51,31 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) +static int da850_evm_mmc_get_ro(int index) +{ + int val; + + val = gpio_get_value(DA850_MMCSD_WP_PIN); + return val; +} Drop the 'val' and make this a one-liner: 'return gpio_get_value(DA850_MMCSD_WP_PIN);' +static int da850_evm_mmc_get_cd(int index) +{ + int val; + + val = gpio_get_value(DA850_MMCSD_CD_PIN); + return !val; +} ditto otherwise, looks ok. Kevin ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH v2] davinci: Add NOR flash support for da850/omap-l138
Sudhakar Rajashekhara sudhakar@ti.com writes: This patch adds platform data for the 8MB NOR flash found on da850/omap-l138 EVM. Both NOR and NAND can co-exist on da850/omap-l138 as they are using different chip selects. Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com --- Since the previous version, EMA_BA_0 pin has been removed from the mux table as this pin is not being used on DA850/OMAP-L138 EVM for NOR. This patch depends on the following patches which I have submitted to davinci git: [PATCH v2] davinci: Configure MDIO pins for EMAC [PATCH v2] davinci: Add platform support for da850/omap-l138 GLCD [PATCH v2] davinci: Add MMC/SD support for da850/omap-l138 [PATCH v2] davinci: Add NAND flash support for DA850/OMAP-L138 Would it be possible to do all these additions without the #ifdefs in the board file like you did for GLCD. IOW, just create/register all of them. The platform_device will be created and potentially waste some memory if the corresponding platform_driver is never created, but it makes things a bit more flexible. Are there acutally mux conflicts between some of these devices? If so, until we get some better support for dynamic mux, I think it would more clear to have this documented (maybe with warnings) in the board file so users don't have to experiment with Kconfig options to find a working config. arch/arm/mach-davinci/board-da850-evm.c| 60 arch/arm/mach-davinci/da850.c | 50 +++ arch/arm/mach-davinci/include/mach/da8xx.h |2 + arch/arm/mach-davinci/include/mach/mux.h | 34 4 files changed, 146 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b879cc5..6087458 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -23,6 +23,7 @@ #include linux/mtd/mtd.h #include linux/mtd/nand.h #include linux/mtd/partitions.h +#include linux/mtd/physmap.h #include asm/mach-types.h #include asm/mach/arch.h @@ -47,6 +48,41 @@ /* GPIO 4[1] is used for MMC/SD WP - 16 * 4 + 1 = 65 */ #define DA850_MMCSD_WP_PIN 65 +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) +static struct mtd_partition da850_evm_norflash_partition[] = { + { + .name = NOR filesystem, + .offset = 0, + .size = MTDPART_SIZ_FULL, + .mask_flags = 0, + }, +}; + +static struct physmap_flash_data da850_evm_norflash_data = { + .width = 2, + .parts = da850_evm_norflash_partition, + .nr_parts = ARRAY_SIZE(da850_evm_norflash_partition), +}; + +static struct resource da850_evm_norflash_resource[] = { + { + .start = DA8XX_AEMIF_CS2_BASE, + .end= DA8XX_AEMIF_CS2_BASE + SZ_32M - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device da850_evm_norflash_device = { + .name = physmap-flash, + .id = 0, + .dev= { + .platform_data = da850_evm_norflash_data, + }, + .num_resources = 1, + .resource = da850_evm_norflash_resource, +}; +#endif + #if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash * (128K blocks). It may be used instead of the (default) SPI flash @@ -130,6 +166,9 @@ static struct platform_device *da850_evm_devices[] __initdata = { #if defined(CONFIG_MTD_NAND_DAVINCI) || defined(CONFIG_MTD_NAND_DAVINCI_MODULE) da850_evm_nandflash_device, #endif +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) + da850_evm_norflash_device, +#endif }; #if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) @@ -192,6 +231,18 @@ static int da850_lcd_hw_init(void) return 0; } +static void __init da850_evm_init_nor(void) +{ + void __iomem *aemif_addr; + + aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K - 1); Why the -1 here? + /* Configure data bus width of CS2 to 16 bit */ + __raw_writel(1, aemif_addr + 0x10); Just use writel(), and also some symobilc names would help readability instead of using hard-coded constants. + iounmap(aemif_addr); +} + static __init void da850_evm_init(void) { struct davinci_soc_info *soc_info = davinci_soc_info; @@ -204,6 +255,15 @@ static __init void da850_evm_init(void) ret); #endif +#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) + ret = da8xx_pinmux_setup(da850_nor_pins); + if (ret) + pr_warning(da850_evm_init: nor mux setup failed: %d\n, + ret); + +
Re: [PATCH v2] ARM: DaVinci: Audio support for DA830 EVM
Chaithrika U S chaithr...@ti.com writes: Define resources for McASP1 used on DA830/OMAP-L137 EVM, add platform device defintion, initialization function. Additionally, this patch also adds version and FIFO related members to platform data structure. Signed-off-by: Chaithrika U S chaithr...@ti.com --- Applies to DaVinci GIT tree. In this version of the patch, the init fucntion, resource and platform device definitions have neen moved to the devices-da8xx.c file. Looks fine. I'll merge these two 'ARM: DaVinci: *' patches via DaVinci git (after changing the subject prefix to just davinci:) Merging them via davinci git will prevent conflicts in linux-next because these are touching code that is being changed from multiple directions. Kevin arch/arm/mach-davinci/board-da830-evm.c| 27 + arch/arm/mach-davinci/da830.c |7 +++-- arch/arm/mach-davinci/devices-da8xx.c | 36 arch/arm/mach-davinci/include/mach/asp.h | 15 +++ arch/arm/mach-davinci/include/mach/da8xx.h |3 ++ 5 files changed, 85 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 9025669..a45340d 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -23,6 +23,7 @@ #include mach/irqs.h #include mach/cp_intc.h #include mach/da8xx.h +#include mach/asp.h #define DA830_EVM_PHY_MASK 0x0 #define DA830_EVM_MDIO_FREQUENCY 220 /* PHY bus frequency */ @@ -51,6 +52,25 @@ static struct davinci_uart_config da830_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +static u8 da830_iis_serializer_direction[] = { + RX_MODE,INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, + INACTIVE_MODE, TX_MODE,INACTIVE_MODE, INACTIVE_MODE, + INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, +}; + +static struct snd_platform_data da830_evm_snd_data = { + .tx_dma_offset = 0x2000, + .rx_dma_offset = 0x2000, + .op_mode= DAVINCI_MCASP_IIS_MODE, + .num_serializer = ARRAY_SIZE(da830_iis_serializer_direction), + .tdm_slots = 2, + .serial_dir = da830_iis_serializer_direction, + .eventq_no = EVENTQ_0, + .version= MCASP_VERSION_2, + .txnumevt = 1, + .rxnumevt = 1, +}; + static __init void da830_evm_init(void) { struct davinci_soc_info *soc_info = davinci_soc_info; @@ -93,6 +113,13 @@ static __init void da830_evm_init(void) davinci_serial_init(da830_evm_uart_config); i2c_register_board_info(1, da830_evm_i2c_devices, ARRAY_SIZE(da830_evm_i2c_devices)); + + ret = da8xx_pinmux_setup(da830_mcasp1_pins); + if (ret) + pr_warning(da830_evm_init: mcasp1 mux setup failed: %d\n, + ret); + + da8xx_init_mcasp(1, da830_evm_snd_data); } #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 3a9b634..19b2748 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -23,6 +23,7 @@ #include mach/common.h #include mach/time.h #include mach/da8xx.h +#include mach/asp.h #include clock.h #include mux.h @@ -411,9 +412,9 @@ static struct davinci_clk da830_clks[] = { CLK(eqep.0, NULL, eqep0_clk), CLK(eqep.1, NULL, eqep1_clk), CLK(da830_lcdc, NULL, lcdc_clk), - CLK(soc-audio.0, NULL, mcasp0_clk), - CLK(soc-audio.1, NULL, mcasp1_clk), - CLK(soc-audio.2, NULL, mcasp2_clk), + CLK(davinci-mcasp.0, NULL, mcasp0_clk), + CLK(davinci-mcasp.1, NULL, mcasp1_clk), + CLK(davinci-mcasp.2, NULL, mcasp2_clk), CLK(musb_hdrc,NULL, usb20_clk), CLK(NULL, aemif,aemif_clk), CLK(NULL, aintc,aintc_clk), diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 11c0971..fe0baaf 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -281,7 +281,43 @@ static struct platform_device da8xx_emac_device = { .resource = da8xx_emac_resources, }; +static struct resource da830_mcasp1_resources[] = { + { + .name = mcasp1, + .start = DAVINCI_DA830_MCASP1_REG_BASE, + .end= DAVINCI_DA830_MCASP1_REG_BASE + (SZ_1K * 12) - 1, + .flags = IORESOURCE_MEM, + }, + /* TX event */ + { + .start = DAVINCI_DA830_DMA_MCASP1_AXEVT, + .end= DAVINCI_DA830_DMA_MCASP1_AXEVT, + .flags = IORESOURCE_DMA, + }, + /* RX
Re: [alsa-devel] [PATCH] ARM: DaVinci: Audio support for DA850/OMAP-L138 EVM
Chaithrika U S chaithr...@ti.com writes: Define resources for McASP used on DA850/OMAP-L138 EVM, add platform device defintion and Pin Mux configurations. Signed-off-by: Chaithrika U S chaithr...@ti.com --- Applies on DaVinci GIT tree. This patch is dependent on the following patch which I have submitted earlier: [PATCH v2] ARM: DaVinci: Audio support for DA830 EVM Pushed both to davinci git, and will queue for linux-next. Kevin arch/arm/mach-davinci/board-da850-evm.c | 29 ++ arch/arm/mach-davinci/da850.c| 39 ++ arch/arm/mach-davinci/devices-da8xx.c| 34 +- arch/arm/mach-davinci/include/mach/asp.h |7 + arch/arm/mach-davinci/include/mach/mux.h | 25 +++ 5 files changed, 133 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index d989346..52bfe4c 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -38,6 +38,28 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { .enabled_uarts = 0x7, }; +/* davinci da850 evm audio machine driver */ +static u8 da850_iis_serializer_direction[] = { + INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, + INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, + INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, TX_MODE, + RX_MODE,INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, +}; + +static struct snd_platform_data da850_evm_snd_data = { + .tx_dma_offset = 0x2000, + .rx_dma_offset = 0x2000, + .op_mode= DAVINCI_MCASP_IIS_MODE, + .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), + .tdm_slots = 2, + .serial_dir = da850_iis_serializer_direction, + .eventq_no = EVENTQ_1, + .version= MCASP_VERSION_2, + .txnumevt = 1, + .rxnumevt = 1, +}; + + static __init void da850_evm_init(void) { struct davinci_soc_info *soc_info = davinci_soc_info; @@ -86,6 +108,13 @@ static __init void da850_evm_init(void) */ __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); + + ret = da8xx_pinmux_setup(da850_mcasp_pins); + if (ret) + pr_warning(da850_evm_init: mcasp mux setup failed: %d\n, + ret); + + da8xx_init_mcasp(0, da850_evm_snd_data); } #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 4a43ae2..e33b226 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -289,6 +289,13 @@ static struct clk emac_clk = { .lpsc = DA8XX_LPSC1_CPGMAC, }; +static struct clk mcasp_clk = { + .name = mcasp, + .parent = pll0_sysclk2, + .lpsc = DA8XX_LPSC1_McASP0, + .psc_ctlr = 1, +}; + static struct davinci_clk da850_clks[] = { CLK(NULL, ref, ref_clk), CLK(NULL, pll0, pll0_clk), @@ -326,6 +333,7 @@ static struct davinci_clk da850_clks[] = { CLK(NULL, arm, arm_clk), CLK(NULL, rmii, rmii_clk), CLK(davinci_emac.1, NULL, emac_clk), + CLK(davinci-mcasp.0, NULL, mcasp_clk), CLK(NULL, NULL, NULL), }; @@ -370,6 +378,30 @@ static const struct mux_config da850_pins[] = { MUX_CFG(DA850, MII_RXD_2, 3, 20, 15, 8, false) MUX_CFG(DA850, MII_RXD_1, 3, 24, 15, 8, false) MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false) + /* McASP function */ + MUX_CFG(DA850, ACLKR, 0, 0, 15, 1, false) + MUX_CFG(DA850, ACLKX, 0, 4, 15, 1, false) + MUX_CFG(DA850, AFSR, 0, 8, 15, 1, false) + MUX_CFG(DA850, AFSX, 0, 12, 15, 1, false) + MUX_CFG(DA850, AHCLKR, 0, 16, 15, 1, false) + MUX_CFG(DA850, AHCLKX, 0, 20, 15, 1, false) + MUX_CFG(DA850, AMUTE, 0, 24, 15, 1, false) + MUX_CFG(DA850, AXR_15, 1, 0, 15, 1, false) + MUX_CFG(DA850, AXR_14, 1, 4, 15, 1, false) + MUX_CFG(DA850, AXR_13, 1, 8, 15, 1, false) + MUX_CFG(DA850, AXR_12, 1, 12, 15, 1, false) + MUX_CFG(DA850, AXR_11, 1, 16, 15, 1, false) + MUX_CFG(DA850, AXR_10, 1, 20, 15, 1, false) + MUX_CFG(DA850, AXR_9,
RE: [PATCH v0 1/5] DaVinci - re-structuring code to support vpif capture driver
Kevin, Thanks for reviewing this. See below for my response. Murali Karicheri Software Design Engineer Texas Instruments Inc. Germantown, MD 20874 email: m-kariche...@ti.com snip #define VIDCH2CLK (BIT(10)) #define VIDCH3CLK (BIT(11)) +#define VIDCH1CLK (BIT(4)) +#define TVP7002_INPUT (BIT(4)) +#define TVP5147_INPUT (~BIT(4)) +#define VPIF_INPUT_ONE_CHANNEL (BIT(5)) +#define VPIF_INPUT_TWO_CHANNEL (~BIT(5)) Hmm, I think the usage of the ~BIT(x) definitions are not exactly clear. Is it not clear that for selecting one channel mode you need to set bit 5 and two channel mode requires it to be reset from this? This looks very obvious for me. I'd rather just see the single BIT(x) definition, and code the use of them differently... Other way is to define it as Logical OR of all BITs except BIT5. Is it what you looking for? This will be unnecessary IMHO. +#define TVP5147_CH0 tvp514x-0 +#define TVP5147_CH1 tvp514x-1 + Snip + */ +static int setup_vpif_input_path(int channel, const char *sub_dev_name) +{ +int err = 0; +int val; + +/* for channel 1, we don't do anything */ +if (channel != 0) +return 0; + +if (NULL == cpld_client) +return -EFAULT; + +val = i2c_smbus_read_byte(cpld_client); +if (val 0) +return val; + +if (!strcmp(sub_dev_name, TVP5147_CH0) || +!strcmp(sub_dev_name, TVP5147_CH1)) Hmm, shouldn't this be '' instead of '||'. No. You want to do this for either TVP5147_CH0 or TVP5147_CH1. How can this be since the strcmp returns zero when there is a match? +val = TVP5147_INPUT; rather: val = ~TVP7002_INPUT; /* tvp5147 input */ TVP5147_INPUT is defined as a 0 for bit4. So val = TVP5147_INPUT is correct. +else +val |= TVP7002_INPUT; + +err = i2c_smbus_write_byte(cpld_client, val); +if (err) +return err; +return 0; +} + +/** + * setup_vpif_input_channel_mode() + * @mux_mode: mux mode. 0 - 1 channel or (1) - 2 channel + * + * This will setup input mode to one channel (TVP7002) or 2 channel (TVP5147) + */ +static int setup_vpif_input_channel_mode(int mux_mode) +{ +int err = 0; +int val; +u32 value; +void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE); Use ioremap() + readl/writel instead of IO_ADDRESS() + __raw_read/__raw_write. Ok. I will change this. +val = i2c_smbus_read_byte(cpld_client); +if (val 0) +return val; + +value = __raw_readl(base + VSCLKDIS_OFFSET); +if (mux_mode) { +val = VPIF_INPUT_TWO_CHANNEL; +value |= VIDCH1CLK; +} else { +val |= VPIF_INPUT_ONE_CHANNEL; +value = ~VIDCH1CLK; +} +__raw_writel(value, base + VSCLKDIS_OFFSET); + +err = i2c_smbus_write_byte(cpld_client, val); +if (err) +return err; + +return 0; +} + +static struct tvp514x_platform_data tvp5146_pdata = { +.clk_polarity = 0, +.hs_polarity = 1, +.vs_polarity = 1 +}; + +#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) + +static struct vpif_subdev_info vpif_capture_sdev_info[] = { +{ +.name = TVP5147_CH0, +.board_info = { +I2C_BOARD_INFO(tvp5146, 0x5d), +.platform_data = tvp5146_pdata, +}, +.input = INPUT_CVBS_VI2B, +.output = OUTPUT_10BIT_422_EMBEDDED_SYNC, +.can_route = 1, +.vpif_if = { +.if_type = VPIF_IF_BT656, +.hd_pol = 1, +.vd_pol = 1, +.fid_pol = 0, +}, +}, +{ +.name = TVP5147_CH1, +.board_info = { +I2C_BOARD_INFO(tvp5146, 0x5c), +.platform_data = tvp5146_pdata, +}, +.input = INPUT_SVIDEO_VI2C_VI1C, +.output = OUTPUT_10BIT_422_EMBEDDED_SYNC, +.can_route = 1, +.vpif_if = { +.if_type = VPIF_IF_BT656, +.hd_pol = 1, +.vd_pol = 1, +.fid_pol = 0, +}, +}, +}; + +static const struct vpif_input dm6467_ch0_inputs[] = { +{ +.input = { +.index = 0, +.name = Composite, +.type = V4L2_INPUT_TYPE_CAMERA, +.std = TVP514X_STD_ALL, +}, +.subdev_name = TVP5147_CH0, +}, +}; + +static const struct vpif_input dm6467_ch1_inputs[] = { + { +.input = { +.index = 0, +.name = S-Video, +.type = V4L2_INPUT_TYPE_CAMERA, +.std = TVP514X_STD_ALL, +}, +
RE: [PATCH v0 4/5] V4L: vpif_capture driver for DM6467
Hans, Thanks for reviewing this. I have some questions though against your comments. Please see below for details.. Murali Karicheri Software Design Engineer Texas Instruments Inc. Germantown, MD 20874 email: m-kariche...@ti.com First of all I've reviewed the other patches in this series and they look OK to me. So you can add Reviewed-by: Hans Verkuil hverk...@xs4all.nl for patches 1, 2, 3 and 5. Will do. +ret = vpif_check_format(ch, common-fmt.fmt.pix, 0); +if (ret) +return ret; + +/* Enable streamon on the sub device */ +ret = v4l2_device_call_until_err(vpif_obj.v4l2_dev, + vpif_obj.sd[ch-curr_sd_index]-grp_id, + video, s_stream, 1); + +if (ret (ret != -ENOIOCTLCMD)) { +vpif_dbg(1, debug, stream on failed in subdev\n); +return ret; +} I strongly recommend that instead of calling the subdev for the current input indirectly using v4l2_device_call_until_err() you use the v4l2_subdev pointer associated with the current input directly. So typically when the input is changed you update a ch-curr_sd pointer to the associated struct v4l2_subdev. After that you can just call v4l2_subdev_call(ch-sd, video, s_stream, 1). Much more concise. In addition the v4l2_device_call_until_err() macro will replace the ENOIOCTLCMD error by 0. The idea behind this macro is that you have an unknown number of subdevs (= 0) that might be interested in this command, but if no one is, then that's fine too. So in the code above the extra check to see whether the return code was -ENOIOCTLCMD is not needed in the case of v4l2_device_call_until_err(). But it is needed if you switch to v4l2_subdev_call(). So in short what you are suggesting is to replace all instances of v4l2_device_call_until_err() with v4l2_subdev_call() since after input selection we know exactly which sub device to direct the application request to. +.fops = vpif_fops, +.minor = -1, +.ioctl_ops = vpif_ioctl_ops, +.current_norm = V4L2_STD_625_50, No need to set current_norm since it's overridden by g_std. You mean s_std() right? Note: I've just found a bug in the default handling of VIDIOC_G_PARM in v4l2-ioctl.c since that uses current_norm even when g_std is defined. I will make a fix for that. As a general remark I have to say that I never liked that v4l2-ioctl has default handling for g_std. It's a dangerous construction that will definitely fail whenever you have both video and vbi device nodes. Ok. Understood. So I will make the next set of patches with the changes suggested by you and It would be ready for merge to your tree as well as to v4l-dvb linux-next tree (through your pull request to Mauro) Thanks and regards, Murali ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH v0 4/5] V4L: vpif_capture driver for DM6467
On Wednesday 12 August 2009 22:31:11 Karicheri, Muralidharan wrote: Hans, Thanks for reviewing this. I have some questions though against your comments. Please see below for details.. Murali Karicheri Software Design Engineer Texas Instruments Inc. Germantown, MD 20874 email: m-kariche...@ti.com First of all I've reviewed the other patches in this series and they look OK to me. So you can add Reviewed-by: Hans Verkuil hverk...@xs4all.nl for patches 1, 2, 3 and 5. Will do. + ret = vpif_check_format(ch, common-fmt.fmt.pix, 0); + if (ret) + return ret; + + /* Enable streamon on the sub device */ + ret = v4l2_device_call_until_err(vpif_obj.v4l2_dev, + vpif_obj.sd[ch-curr_sd_index]-grp_id, + video, s_stream, 1); + + if (ret (ret != -ENOIOCTLCMD)) { + vpif_dbg(1, debug, stream on failed in subdev\n); + return ret; + } I strongly recommend that instead of calling the subdev for the current input indirectly using v4l2_device_call_until_err() you use the v4l2_subdev pointer associated with the current input directly. So typically when the input is changed you update a ch-curr_sd pointer to the associated struct v4l2_subdev. After that you can just call v4l2_subdev_call(ch-sd, video, s_stream, 1). Much more concise. In addition the v4l2_device_call_until_err() macro will replace the ENOIOCTLCMD error by 0. The idea behind this macro is that you have an unknown number of subdevs (= 0) that might be interested in this command, but if no one is, then that's fine too. So in the code above the extra check to see whether the return code was -ENOIOCTLCMD is not needed in the case of v4l2_device_call_until_err(). But it is needed if you switch to v4l2_subdev_call(). So in short what you are suggesting is to replace all instances of v4l2_device_call_until_err() with v4l2_subdev_call() since after input selection we know exactly which sub device to direct the application request to. Yes. I think that is the best approach here. + .fops = vpif_fops, + .minor = -1, + .ioctl_ops = vpif_ioctl_ops, + .current_norm = V4L2_STD_625_50, No need to set current_norm since it's overridden by g_std. You mean s_std() right? Hmm, that was a bad sentence of mine. What I meant is that if you define the g_std function, then the current_norm will not be used by the v4l2-ioctl code. If you do not give it a g_std function, then the v4l2-ioctl code will return current_norm instead. So you either have a g_std function and do not setup current_norm, or you use current_norm and omit g_std. Personally I think that current_norm handling only confuses people and all drivers should just make a g_std function. Note: I've just found a bug in the default handling of VIDIOC_G_PARM in v4l2-ioctl.c since that uses current_norm even when g_std is defined. I will make a fix for that. As a general remark I have to say that I never liked that v4l2-ioctl has default handling for g_std. It's a dangerous construction that will definitely fail whenever you have both video and vbi device nodes. Ok. Understood. So I will make the next set of patches with the changes suggested by you and It would be ready for merge to your tree as well as to v4l-dvb linux-next tree (through your pull request to Mauro) Excellent news! Regards, Hans Thanks and regards, Murali -- Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source