diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2016-09-05 15:43:17 -0400 |
---|---|---|
committer | Archit Taneja <architt@codeaurora.org> | 2016-09-12 03:50:43 -0400 |
commit | d25a4cbba4b9da7c2d674b2f8ecf84af1b24988e (patch) | |
tree | 75820a5ee36f32a68a54d2933be42379555c0de9 | |
parent | dec90ea1456b5a5d990d94ade2e45a2457cfd149 (diff) |
drm/bridge: adv7511: add support for the 2nd chip
The Renesas Wheat board has 2 ADV7513 chips on the same I2C bus, however
the ADV751x driver only supports 1 chip as it tries to assign the packet/
EDID/CEC memory I2C devices to the fixed I2C addresses. Assign these I2C
addresses at the fixed offsets (derived from the programming guide) from
the main register map address instead.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1580212.O1LYdJFM97@wasted.cogentembedded.com
-rw-r--r-- | drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/bridge/adv7511/adv7533.c | 5 |
2 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index ec8fb2ed3275..8ed3906dd411 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | |||
@@ -922,15 +922,13 @@ static int adv7511_parse_dt(struct device_node *np, | |||
922 | return 0; | 922 | return 0; |
923 | } | 923 | } |
924 | 924 | ||
925 | static const int edid_i2c_addr = 0x7e; | ||
926 | static const int packet_i2c_addr = 0x70; | ||
927 | static const int cec_i2c_addr = 0x78; | ||
928 | |||
929 | static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) | 925 | static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) |
930 | { | 926 | { |
931 | struct adv7511_link_config link_config; | 927 | struct adv7511_link_config link_config; |
932 | struct adv7511 *adv7511; | 928 | struct adv7511 *adv7511; |
933 | struct device *dev = &i2c->dev; | 929 | struct device *dev = &i2c->dev; |
930 | unsigned int main_i2c_addr = i2c->addr << 1; | ||
931 | unsigned int edid_i2c_addr = main_i2c_addr + 4; | ||
934 | unsigned int val; | 932 | unsigned int val; |
935 | int ret; | 933 | int ret; |
936 | 934 | ||
@@ -991,8 +989,10 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) | |||
991 | 989 | ||
992 | regmap_write(adv7511->regmap, ADV7511_REG_EDID_I2C_ADDR, edid_i2c_addr); | 990 | regmap_write(adv7511->regmap, ADV7511_REG_EDID_I2C_ADDR, edid_i2c_addr); |
993 | regmap_write(adv7511->regmap, ADV7511_REG_PACKET_I2C_ADDR, | 991 | regmap_write(adv7511->regmap, ADV7511_REG_PACKET_I2C_ADDR, |
994 | packet_i2c_addr); | 992 | main_i2c_addr - 0xa); |
995 | regmap_write(adv7511->regmap, ADV7511_REG_CEC_I2C_ADDR, cec_i2c_addr); | 993 | regmap_write(adv7511->regmap, ADV7511_REG_CEC_I2C_ADDR, |
994 | main_i2c_addr - 2); | ||
995 | |||
996 | adv7511_packet_disable(adv7511, 0xffff); | 996 | adv7511_packet_disable(adv7511, 0xffff); |
997 | 997 | ||
998 | adv7511->i2c_main = i2c; | 998 | adv7511->i2c_main = i2c; |
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7533.c b/drivers/gpu/drm/bridge/adv7511/adv7533.c index 5eebd15899b1..d7f7b7ce8ebe 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7533.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c | |||
@@ -149,13 +149,12 @@ void adv7533_uninit_cec(struct adv7511 *adv) | |||
149 | i2c_unregister_device(adv->i2c_cec); | 149 | i2c_unregister_device(adv->i2c_cec); |
150 | } | 150 | } |
151 | 151 | ||
152 | static const int cec_i2c_addr = 0x78; | ||
153 | |||
154 | int adv7533_init_cec(struct adv7511 *adv) | 152 | int adv7533_init_cec(struct adv7511 *adv) |
155 | { | 153 | { |
156 | int ret; | 154 | int ret; |
157 | 155 | ||
158 | adv->i2c_cec = i2c_new_dummy(adv->i2c_main->adapter, cec_i2c_addr >> 1); | 156 | adv->i2c_cec = i2c_new_dummy(adv->i2c_main->adapter, |
157 | adv->i2c_main->addr - 1); | ||
159 | if (!adv->i2c_cec) | 158 | if (!adv->i2c_cec) |
160 | return -ENOMEM; | 159 | return -ENOMEM; |
161 | 160 | ||