AnsweredAssumed Answered

ADV7511 HDMI transmitter linux

Question asked by waman on Feb 16, 2015
Latest reply on Feb 16, 2015 by larsc

Hello:

 

I've a custom board on AM335x with ADV7511 HDMI transmitter

LCD lines are up. I'm not able to get the I2C working here. My hardware team was able to write i2c on 0x39 0x41 0x10 through some windows i2c utility and the display was up and running. I want to do the similar stuff through Linux. Please check my code below.

 

 

Linux details;

Linux am335x-evm 3.2.0 #106 PREEMPT Wed Feb 11 17:05:13 IST 2015 armv7l GNU/Linux

 

I've also followed the below link

ADV7511 HDMI transmitter Linux Driver [Analog Devices Wiki]

 

/* I2C2 */

/* HDMI Transmitter ADV7513BSWZ */

 

 

#include "../../../drivers/gpu/drm/i2c/adv7511.h"

 

#define ADV_I2C2_ADDRESS        0x39

#define I2C2_FREQ_KHZ            100

#define I2C2_OMAP_DEV_NUM        2

#define ADV_IRQ_PIN            GPIO_TO_PIN(2, 0)

#define ADV_IRQ_STR            "gpmc_csn3.gpio2_0"

 

static struct pinmux_config i2c2_pin_mux[] = {

    {"uart1_rtsn.i2c2_scl",     OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW | AM33XX_PULL_UP | AM33XX_PIN_OUTPUT},

    {"uart1_ctsn.i2c2_sda",     OMAP_MUX_MODE3 |  AM33XX_SLEWCTRL_SLOW | AM33XX_PULL_UP | AM33XX_INPUT_EN | AM33XX_PIN_INPUT },

    {ADV_IRQ_STR,            OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},

    {NULL, 0},

};

 

static const uint16_t adv7511_csc_ycbcr_to_rgb[] = {

    0x0734, 0x04ad, 0x0000, 0x1c1b,

    0x1ddc, 0x04ad, 0x1f24, 0x0135,

    0x0000, 0x04ad, 0x087c, 0x1b77,

};

 

static struct adv7511_video_input_config adv7511_data = {

    .input_style    = ADV7511_INPUT_STYLE1,

    .id        = ADV7511_INPUT_ID_24BIT_RGB444_YCbCr444,

    .sync_pulse = ADV7511_INPUT_SYNC_PULSE_NONE,

    .clock_delay = ADV7511_INPUT_CLOCK_DELAY_NONE,

    .reverse_bitorder = false,

    .vsync_polarity = ADV7511_SYNC_POLARITY_HIGH,

    .hsync_polarity = ADV7511_SYNC_POLARITY_HIGH,

    .up_conversion = ADV7511_UP_CONVERSION_ZERO_ORDER,

    .input_color_depth = ADV7511_INPUT_COLOR_DEPTH_8BIT,

    .output_format = ADV7511_OUTPUT_FORMAT_RGB_444,

    .csc_enable = true,

    .csc_coefficents = adv7511_csc_ycbcr_to_rgb,

    .csc_scaling_factor = ADV7511_CSC_SCALING_4,

    .bit_justification = ADV7511_INPUT_BIT_JUSTIFICATION_RIGHT,

    .tmds_clock_inversion = true,

};

 

static struct i2c_board_info i2c2_boardinfo[] = {

    {    // HDMI

        I2C_BOARD_INFO("adv7511", ADV_I2C2_ADDRESS),

        .platform_data = &adv7511_data,

    },

};

 

static void __init i2c2_init(void)

{

    setup_pin_mux(i2c2_pin_mux);

 

    omap_register_i2c_bus(I2C2_OMAP_DEV_NUM, I2C2_FREQ_KHZ, i2c2_boardinfo, ARRAY_SIZE(i2c2_boardinfo));

 

}

 

on the board;

 

root@am335x-evm:~# i2c detect -l

i2c-2    i2c           OMAP I2C adapter                    I2C adapter

 

root@am335x-evm:~# i2cdetect -r 2

WARNING! This program can confuse your I2C bus, cause data loss and worse!

I will probe file /dev/i2c-2 using read byte commands.

I will probe address range 0x03-0x77.

Continue? [Y/n]

y

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          [ 7497.375274] omap_i2c omap_i2c.2: controller timed out

 

I'm not able to see anything on the display.

 

Appreciate your support.

 

Regards,

Waman Prabhu

Outcomes