diff options
author | Jon Smirl <jonsmirl@yahoo.com> | 2004-10-19 16:30:02 +0000 |
---|---|---|
committer | Jon Smirl <jonsmirl@yahoo.com> | 2004-10-19 16:30:02 +0000 |
commit | bcfbd73536e8e44b028953e4e04c83d143612a10 (patch) | |
tree | 9960ab33c1c604bfc8a1ff820b2d5658f950fffd /linux-2.6 | |
parent | ca1ec9268f9de783daf3f2db86a4fb47108d609a (diff) |
Fix missing I2C busses to be non-fatal error.
Diffstat (limited to 'linux-2.6')
-rw-r--r-- | linux-2.6/radeon_i2c.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/linux-2.6/radeon_i2c.c b/linux-2.6/radeon_i2c.c index e25917233..df51581c1 100644 --- a/linux-2.6/radeon_i2c.c +++ b/linux-2.6/radeon_i2c.c @@ -76,7 +76,7 @@ static int gpio_getsda(void* data) struct radeon_i2c_chan *chan = data; drm_radeon_private_t *dev_priv = chan->dev->dev_private; u32 val; - + val = RADEON_READ(chan->ddc_reg); return (val & VGA_DDC_DATA_INPUT) ? 1 : 0; @@ -97,7 +97,7 @@ static int setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) chan->algo.getscl = gpio_getscl; chan->algo.udelay = 40; chan->algo.timeout = 20; - chan->algo.data = chan; + chan->algo.data = chan; i2c_set_adapdata(&chan->adapter, chan); @@ -114,30 +114,28 @@ static int setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) return rc; } -int radeon_create_i2c_busses(drm_device_t *dev) +int radeon_create_i2c_busses(drm_device_t * dev) { drm_radeon_private_t *dev_priv = dev->dev_private; - int ret; dev_priv->i2c[0].dev = dev; dev_priv->i2c[0].ddc_reg = GPIO_MONID; - if ((ret = setup_i2c_bus(&dev_priv->i2c[0], "monid"))) - return ret; + /* Don't return the error from setup. It is not fatal */ + /* if the bus can not be initialized */ + setup_i2c_bus(&dev_priv->i2c[0], "monid"); dev_priv->i2c[1].dev = dev; dev_priv->i2c[1].ddc_reg = GPIO_DVI_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[1], "dvi"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[1], "dvi"); dev_priv->i2c[2].dev = dev; dev_priv->i2c[2].ddc_reg = GPIO_VGA_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[2], "vga"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[2], "vga"); dev_priv->i2c[3].dev = dev; dev_priv->i2c[3].ddc_reg = GPIO_CRT2_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[3], "crt2"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[3], "crt2"); + return 0; } @@ -145,7 +143,7 @@ void radeon_delete_i2c_busses(drm_device_t *dev) { drm_radeon_private_t *dev_priv = dev->dev_private; int i, ret; - + for (i = 0; i < 4; i++) { if (dev_priv->i2c[i].dev) { ret = i2c_bit_del_bus(&dev_priv->i2c[i].adapter); |