[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130814122008.GC23840@n2100.arm.linux.org.uk>
Date: Wed, 14 Aug 2013 13:20:08 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
Cc: David Airlie <airlied@...ux.ie>,
Darren Etheridge <detheridge@...com>,
Rob Clark <robdclark@...il.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/8] drm/i2c: tda998x: add video and audio input
configuration
On Tue, Aug 06, 2013 at 12:20:15AM +0200, Sebastian Hesselbarth wrote:
> - also calculate CTS
This is wrong...
> + /*
> + * HDMI 1.3a, 7.2.2 CTS parameter:
> + * (avg cts) = (fTMDS * N) / (128 * fS)
> + */
> + cts = n * mode->clock / p->audio_sample_rate;
> + cts *= 1000;
> + cts /= 128;
This only works if you can guarantee that the audio and video clocks are
synchronous - and that you know the audio sample rate.
I don't believe the audio and video clocks are synchronous on the cubox,
and also have no way to communicate the audio sample rate to the TDA998x
driver at present.
So, this calculation serves little purpose and wastes CPU cycles.
> +static ssize_t i2c_read_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
> +{
> + struct drm_encoder *encoder = dev_get_drvdata(dev);
> + unsigned int page, addr;
> + unsigned char val;
> +
> + sscanf(buf, "%x %x", &page, &addr);
> +
> + val = reg_read(encoder, REG(page, addr));
> +
> + printk("i2c read %02x @ page:%02x address:%02x\n", val, page, addr);
> + return size;
> +}
> +
> +static ssize_t i2c_write_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
> +{
> + struct drm_encoder *encoder = dev_get_drvdata(dev);
> + unsigned int page, addr, mask, val;
> + unsigned char rval;
> +
> + sscanf(buf, "%x %x %x %x", &page, &addr, &mask, &val);
> +
> + rval = reg_read(encoder, REG(page, addr));
> + rval &= ~mask;
> + rval |= val & mask;
> + reg_write(encoder, REG(page, addr), rval);
> +
> + printk("i2c write %02x @ page:%02x address:%02x\n", rval, page, addr);
> + return size;
> +}
> +
> +static DEVICE_ATTR(i2c_read, S_IWUSR, NULL, i2c_read_store);
> +static DEVICE_ATTR(i2c_write, S_IWUSR, NULL, i2c_write_store);
> +
> static int
> tda998x_encoder_init(struct i2c_client *client,
> struct drm_device *dev,
> @@ -817,6 +1111,11 @@ tda998x_encoder_init(struct i2c_client *client,
> {
> struct drm_encoder *encoder = &encoder_slave->base;
> struct tda998x_priv *priv;
> +/* debug */
> + device_create_file(&client->dev, &dev_attr_i2c_read);
> + device_create_file(&client->dev, &dev_attr_i2c_write);
> + dev_set_drvdata(&client->dev, encoder);
> +/* debug end */
The above should probably be dropped from this patch; that's for debugging
and is unrelated to the rest of this patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists