public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
	Darren Etheridge <detheridge@ti.com>,
	Rob Clark <robdclark@gmail.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/8] drm/i2c: tda998x: add video and audio input configuration
Date: Wed, 14 Aug 2013 13:20:08 +0100	[thread overview]
Message-ID: <20130814122008.GC23840@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1375741218-10225-6-git-send-email-sebastian.hesselbarth@gmail.com>

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.

  reply	other threads:[~2013-08-14 12:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 22:20 [PATCH 0/8] Several NXP TDA998x patches Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 1/8] drm/i2c: tda998x: fix EDID reading on TDA19988 devices Sebastian Hesselbarth
2013-08-14 12:16   ` Russell King - ARM Linux
2013-08-14 12:32     ` Rob Clark
2013-08-05 22:20 ` [PATCH 2/8] drm/i2c: tda998x: ensure VIP output mux is properly set Sebastian Hesselbarth
2013-08-14 12:15   ` Russell King - ARM Linux
2013-08-05 22:20 ` [PATCH 3/8] drm/i2c: tda998x: fix npix/nline programming Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 4/8] drm/i2c: tda998x: prepare for video input configuration Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 5/8] drm/i2c: tda998x: add video and audio " Sebastian Hesselbarth
2013-08-14 12:20   ` Russell King - ARM Linux [this message]
2013-08-14 14:12   ` Russell King - ARM Linux
2013-08-14 14:34     ` Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 6/8] drm/i2c: tda998x: fix sync generation and calculation Sebastian Hesselbarth
2013-08-14 12:41   ` Russell King - ARM Linux
2013-08-14 14:14     ` Sebastian Hesselbarth
2013-08-14 14:35   ` Russell King - ARM Linux
2013-08-05 22:20 ` [PATCH 7/8] drm/i2c: tda998x: prepare for broken sync workaround Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 8/8] drm/tilcdc fixup mode to workaound sync for tda998x Sebastian Hesselbarth
2013-08-06 16:26 ` [PATCH 0/8] Several NXP TDA998x patches Etheridge, Darren
2013-08-08 22:08 ` Darren Etheridge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130814122008.GC23840@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=detheridge@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=sebastian.hesselbarth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox