All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jyri Sarha <jsarha@ti.com>
Cc: "Ujfalusi, Peter" <peter.ujfalusi@ti.com>,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org,
	devicetree@vger.kernel.org, bcousson@baylibre.com
Subject: Re: [PATCH RFC v2 REPOST 3/8] ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus
Date: Tue, 21 Jan 2014 19:15:47 +0000	[thread overview]
Message-ID: <20140121191547.GX17314@sirena.org.uk> (raw)
In-Reply-To: <52D67099.1040904@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]

On Wed, Jan 15, 2014 at 01:27:21PM +0200, Jyri Sarha wrote:
> On 12/31/2013 03:25 PM, Mark Brown wrote:

> >>support. The only supported sample format is SNDRV_PCM_FORMAT_S32_LE.
> >>The 8 least significant bits are ignored.

> >Where does this constraint come from?

> From driver/gpu/drm/i2c/tda998x_drv.c. The driver configures CTS_N
> register statically to a value that works only with 4 byte samples.
> According to my tests it is possible to support 3 and 2 byte samples
> too by changing the CTS_N register value, but I am not sure if the
> configuration can be changed on the fly. My data sheet of the nxp
> chip is very vague about the register definitions, but I suppose the
> register configures some clock divider on the chip. HDMI supports
> only upto 24bit audio and the data sheet states that any extraneous
> least significant bits are ignored.

Hrm.  This sounds like it ought to be presenting as an ASoC CODEC
driver.

> >>+	snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_CHANNELS,
> >>+				     2, 2);

> >Why not just set all this statically when registering the DAI?

> Because there is no relevant DAI to where to put these limitations.
> I did not want to add yet another dummy codec driver, but decided to
> use the already existing ASoC HDMI codec. By default the driver
> support all audio params supported by HDMI. The limitations are
> coming from NXP chip, the NXP driver, and because the chip is used
> in i2s mode. In other words the limitation is coming from machine
> setup, not from the DAIs.

OK, but it sounds like it's got register configuration as well?  That
really does sound like a device that ought to have a driver...

> No excuse for i initialization, I'll fix that. The casting is just
> to survive with just one kmalloc call instead of separate memory
> blobs for
> struct snd_pcm_hw_constraint_list and referred list of supported
> sample rates. I'll allocate a second blob, if that is easier to
> read.

Yes, please.  Unless it's something where memory is getting tight (eg,
due to be allocated a lot) it's more important that we can read the code
than that we save a few bytes.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: broonie@kernel.org (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC v2 REPOST 3/8] ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus
Date: Tue, 21 Jan 2014 19:15:47 +0000	[thread overview]
Message-ID: <20140121191547.GX17314@sirena.org.uk> (raw)
In-Reply-To: <52D67099.1040904@ti.com>

On Wed, Jan 15, 2014 at 01:27:21PM +0200, Jyri Sarha wrote:
> On 12/31/2013 03:25 PM, Mark Brown wrote:

> >>support. The only supported sample format is SNDRV_PCM_FORMAT_S32_LE.
> >>The 8 least significant bits are ignored.

> >Where does this constraint come from?

> From driver/gpu/drm/i2c/tda998x_drv.c. The driver configures CTS_N
> register statically to a value that works only with 4 byte samples.
> According to my tests it is possible to support 3 and 2 byte samples
> too by changing the CTS_N register value, but I am not sure if the
> configuration can be changed on the fly. My data sheet of the nxp
> chip is very vague about the register definitions, but I suppose the
> register configures some clock divider on the chip. HDMI supports
> only upto 24bit audio and the data sheet states that any extraneous
> least significant bits are ignored.

Hrm.  This sounds like it ought to be presenting as an ASoC CODEC
driver.

> >>+	snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_CHANNELS,
> >>+				     2, 2);

> >Why not just set all this statically when registering the DAI?

> Because there is no relevant DAI to where to put these limitations.
> I did not want to add yet another dummy codec driver, but decided to
> use the already existing ASoC HDMI codec. By default the driver
> support all audio params supported by HDMI. The limitations are
> coming from NXP chip, the NXP driver, and because the chip is used
> in i2s mode. In other words the limitation is coming from machine
> setup, not from the DAIs.

OK, but it sounds like it's got register configuration as well?  That
really does sound like a device that ought to have a driver...

> No excuse for i initialization, I'll fix that. The casting is just
> to survive with just one kmalloc call instead of separate memory
> blobs for
> struct snd_pcm_hw_constraint_list and referred list of supported
> sample rates. I'll allocate a second blob, if that is easier to
> read.

Yes, please.  Unless it's something where memory is getting tight (eg,
due to be allocated a lot) it's more important that we can read the code
than that we save a few bytes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140121/b1d094fe/attachment.sig>

  parent reply	other threads:[~2014-01-21 19:15 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 12:12 [PATCH RFC 0/9] Beaglebone-Black HDMI audio Jyri Sarha
2013-11-19 12:12 ` Jyri Sarha
2013-11-19 12:12 ` [PATCH RFC 1/9] clk: add gpio controlled clock Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 12:12 ` [PATCH RFC 2/9] ASoC: davinci-evm: Add named clock reference to DT bindings Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 18:18   ` Mark Brown
2013-11-19 18:18     ` Mark Brown
2013-11-19 12:12 ` [PATCH RFC 3/9] ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 15:07   ` Thomas Petazzoni
2013-11-19 15:07     ` Thomas Petazzoni
2013-11-19 12:12 ` [PATCH RFC 4/9] ASoC: hdmi-codec: Add devicetree binding with documentation Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 17:50   ` Mark Brown
2013-11-19 17:50     ` Mark Brown
2013-11-20  9:23   ` Jean-Francois Moine
2013-11-20  9:23     ` Jean-Francois Moine
2013-11-20 10:09     ` Mark Brown
2013-11-20 10:09       ` Mark Brown
2013-11-20 12:34       ` Jean-Francois Moine
2013-11-20 12:34         ` Jean-Francois Moine
2013-11-20 13:33         ` Mark Brown
2013-11-20 13:33           ` Mark Brown
2013-11-19 12:12 ` [PATCH RFC 5/9] ASoC: hdmi-codec: Add SNDRV_PCM_FMTBIT_32_LE playback format Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 18:21   ` Mark Brown
2013-11-19 18:21     ` Mark Brown
2013-11-19 12:12 ` [PATCH RFC 6/9] ASoC: davinci: HDMI audio build for AM33XX and TDA998x Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 12:12 ` [PATCH RFC 7/9] drm/tilcdc: Add I2C HDMI audio config for tda998x Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 12:12 ` [PATCH RFC 8/9] ARM: OMAP2+: omap2plus_defconfig: Enable tilcdc and TDA998X HDMI support Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 12:12 ` [PATCH RFC 9/9] ARM: OMAP2+: omap2plus_defconfig: Enable BeagleBone Black HDMI audio support Jyri Sarha
2013-11-19 12:12   ` Jyri Sarha
2013-11-19 12:21 ` [PATCH RFC] DTS Changes for Beaglebone-Black HDMI audio Jyri Sarha
2013-11-19 12:21   ` Jyri Sarha
2013-11-19 12:21   ` [PATCH RFC] ARM/dts: am335x-boneblack: Add HDMI audio support Jyri Sarha
2013-11-19 12:21     ` Jyri Sarha
2013-11-19 13:02     ` Benoit Cousson
2013-11-19 13:02       ` Benoit Cousson
2013-11-19 13:29       ` Jyri Sarha
2013-11-19 13:29         ` Jyri Sarha
2013-12-08 12:16 ` [RFC v2 0/8] Beaglebone-Black HDMI audio Jyri Sarha
2013-12-08 12:16   ` [RFC v2 1/8] clk: add gpio controlled clock Jyri Sarha
2013-12-08 12:16   ` [RFC v2 2/8] ASoC: davinci-evm: Add named clock reference to DT bindings Jyri Sarha
2013-12-08 12:16   ` [RFC v2 3/8] ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus Jyri Sarha
2013-12-08 12:16   ` [RFC v2 4/8] ASoC: hdmi-codec: Add devicetree binding with documentation Jyri Sarha
2013-12-08 12:16   ` [RFC v2 5/8] ASoC: davinci: HDMI audio build for AM33XX and TDA998x Jyri Sarha
2013-12-08 12:16   ` [RFC v2 6/8] drm/tilcdc: Add I2C HDMI audio config for tda998x Jyri Sarha
2013-12-08 12:16   ` [RFC v2 7/8] ARM: OMAP2+: omap2plus_defconfig: Enable tilcdc and TDA998X HDMI support Jyri Sarha
2013-12-08 12:16   ` [RFC v2 8/8] ARM: OMAP2+: omap2plus_defconfig: Enable BeagleBone Black HDMI audio support Jyri Sarha
2013-12-08 12:20 ` [RFC v2] Beaglebone-Black HDMI audio Jyri Sarha
2013-12-08 12:20   ` [RFC v2] ARM/dts: am335x-boneblack: Add HDMI audio support Jyri Sarha
2013-12-10 18:52     ` Jyri Sarha
     [not found]   ` <cover.1386504183.git.jsarha-l0cyMroinI0@public.gmane.org>
2013-12-10 18:52     ` Jyri Sarha
     [not found] ` <cover.1384862950.git.jsarha-l0cyMroinI0@public.gmane.org>
2013-12-10 18:52   ` [RFC v2] Beaglebone-Black HDMI audio Jyri Sarha
2013-12-20 10:36 ` [PATCH RFC v2 REPOST 0/8] " Jyri Sarha
2013-12-20 10:36   ` Jyri Sarha
2013-12-20 10:37   ` [PATCH RFC v2 REPOST 1/8] clk: add gpio controlled clock Jyri Sarha
2013-12-20 10:37     ` Jyri Sarha
2013-12-20 10:38   ` [PATCH RFC v2 REPOST 2/8] ASoC: davinci-evm: Add named clock reference to DT bindings Jyri Sarha
2013-12-20 10:38     ` Jyri Sarha
2013-12-31 13:16     ` Mark Brown
2013-12-31 13:16       ` Mark Brown
2014-01-15 11:12       ` Jyri Sarha
2014-01-15 11:12         ` Jyri Sarha
2013-12-20 10:39   ` [PATCH RFC v2 REPOST 3/8] ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus Jyri Sarha
2013-12-20 10:39     ` Jyri Sarha
2013-12-31 13:25     ` Mark Brown
2013-12-31 13:25       ` Mark Brown
2014-01-15 11:27       ` Jyri Sarha
2014-01-15 11:27         ` Jyri Sarha
2014-01-15 13:48         ` Anssi Hannula
2014-01-15 13:48           ` [alsa-devel] " Anssi Hannula
2014-01-15 16:28           ` Jyri Sarha
2014-01-15 16:28             ` [alsa-devel] " Jyri Sarha
2014-01-15 15:51         ` Jean-Francois Moine
2014-01-15 15:51           ` Jean-Francois Moine
2014-01-22  9:20           ` Jyri Sarha
2014-01-22  9:20             ` [alsa-devel] " Jyri Sarha
2014-01-22 10:19             ` Jean-Francois Moine
2014-01-22 10:19               ` Jean-Francois Moine
2014-01-22 10:46               ` Jean-Francois Moine
2014-01-22 10:46                 ` Jean-Francois Moine
2014-01-24 12:57                 ` Jyri Sarha
2014-01-24 12:57                   ` [alsa-devel] " Jyri Sarha
2014-01-24 16:54                   ` Jean-Francois Moine
2014-01-24 16:54                     ` Jean-Francois Moine
2014-01-21 19:15         ` Mark Brown [this message]
2014-01-21 19:15           ` Mark Brown
2014-01-24 13:01           ` Jyri Sarha
2014-01-24 13:01             ` Jyri Sarha
2013-12-20 10:40   ` [PATCH RFC v2 REPOST 4/8] ASoC: hdmi-codec: Add devicetree binding with documentation Jyri Sarha
2013-12-20 10:40     ` Jyri Sarha
2013-12-31 13:26     ` Mark Brown
2013-12-31 13:26       ` Mark Brown
2013-12-20 10:40   ` [PATCH RFC v2 REPOST 5/8] ASoC: davinci: HDMI audio build for AM33XX and TDA998x Jyri Sarha
2013-12-20 10:40     ` Jyri Sarha
2013-12-20 10:41   ` [PATCH RFC v2 REPOST 6/8] drm/tilcdc: Add I2C HDMI audio config for tda998x Jyri Sarha
2013-12-20 10:41     ` Jyri Sarha
2013-12-20 10:42   ` [PATCH RFC v2 REPOST 7/8] ARM: OMAP2+: omap2plus_defconfig: Enable tilcdc and TDA998X HDMI support Jyri Sarha
2013-12-20 10:42     ` Jyri Sarha
2013-12-20 10:43   ` [PATCH RFC v2 REPOST 8/8] ARM: OMAP2+: omap2plus_defconfig: Enable BeagleBone Black HDMI audio support Jyri Sarha
2013-12-20 10:43     ` Jyri Sarha
2013-12-20 11:30   ` [alsa-devel] [PATCH RFC v2 REPOST 0/8] Beaglebone-Black HDMI audio Mark Brown
2013-12-20 11:30     ` Mark Brown
2013-12-20 11:51     ` Jyri Sarha
2013-12-20 11:51       ` [alsa-devel] " Jyri Sarha

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=20140121191547.GX17314@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.