lkml.org 
[lkml]   [2015]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 01/11] [media] stv0367: Refine i2c error trace to include i2c address
    Date
    When using stv0367 demodulator with STi STB platforms,
    we can have easily have four or more stv0367 demods running
    in the system at one time.

    As typically the b2120 reference design ships with a b2004a daughter
    board, which can accept two dvb NIM cards, and each b2100A NIM
    has 2x stv0367 demods and 2x NXPs tuner on it.

    In such circumstances it is useful to print the i2c address
    on error messages to know which one is failing due to I2C issues.

    Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
    ---
    drivers/media/dvb-frontends/stv0367.c | 12 ++++++++----
    1 file changed, 8 insertions(+), 4 deletions(-)

    diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c
    index ec3e18e..9a49db1 100644
    --- a/drivers/media/dvb-frontends/stv0367.c
    +++ b/drivers/media/dvb-frontends/stv0367.c
    @@ -791,11 +791,13 @@ int stv0367_writeregs(struct stv0367_state *state, u16 reg, u8 *data, int len)
    memcpy(buf + 2, data, len);

    if (i2cdebug)
    - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, buf[2]);
    + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__,
    + state->config->demod_address, reg, buf[2]);

    ret = i2c_transfer(state->i2c, &msg, 1);
    if (ret != 1)
    - printk(KERN_ERR "%s: i2c write error!\n", __func__);
    + printk(KERN_ERR "%s: i2c write error! ([%02x] %02x: %02x)\n",
    + __func__, state->config->demod_address, reg, buf[2]);

    return (ret != 1) ? -EREMOTEIO : 0;
    }
    @@ -829,10 +831,12 @@ static u8 stv0367_readreg(struct stv0367_state *state, u16 reg)

    ret = i2c_transfer(state->i2c, msg, 2);
    if (ret != 2)
    - printk(KERN_ERR "%s: i2c read error\n", __func__);
    + printk(KERN_ERR "%s: i2c read error ([%02x] %02x: %02x)\n",
    + __func__, state->config->demod_address, reg, b1[0]);

    if (i2cdebug)
    - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, b1[0]);
    + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__,
    + state->config->demod_address, reg, b1[0]);

    return b1[0];
    }
    --
    1.9.1


    \
     
     \ /
      Last update: 2015-07-30 19:21    [W:4.393 / U:0.216 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site