linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Mark Brown <broonie@kernel.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Dave Airlie <airlied@gmail.com>,
	Andrew Jackson <Andrew.Jackson@arm.com>,
	Jyri Sarha <jsarha@ti.com>,
	alsa-devel@alsa-project.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v10 5/9] drm/i2c: tda998x: Change drvdata for audio extension
Date: Tue, 20 Jan 2015 12:16:46 +0100	[thread overview]
Message-ID: <ca8037eca1cbbec18d3917e9268735a88d6ff935.1421782533.git.moinejf@free.fr> (raw)
In-Reply-To: <cover.1421782532.git.moinejf@free.fr>

The device drvdata is used for component bind, but points to the
encoder/connector structure which is hidden from the slave encoder.
For audio extension, the slave encoder private data must be accessible,
so, this patch changes drvdata to the slave encoder private data and
sets it in case of slave encoder use.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index cf245ce..b35f35f 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1465,6 +1465,8 @@ static int tda998x_encoder_init(struct i2c_client *client,
 	encoder_slave->slave_priv = priv;
 	encoder_slave->slave_funcs = &tda998x_encoder_slave_funcs;
 
+	dev_set_drvdata(&client->dev, priv);
+
 	return 0;
 }
 
@@ -1591,7 +1593,7 @@ static int tda998x_bind(struct device *dev, struct device *master, void *data)
 	if (!priv)
 		return -ENOMEM;
 
-	dev_set_drvdata(dev, priv);
+	dev_set_drvdata(dev, &priv->base);
 
 	priv->base.encoder = &priv->encoder;
 	priv->connector.interlace_allowed = 1;
@@ -1641,7 +1643,9 @@ err_encoder:
 static void tda998x_unbind(struct device *dev, struct device *master,
 			   void *data)
 {
-	struct tda998x_priv2 *priv = dev_get_drvdata(dev);
+	struct tda998x_priv *priv_s = dev_get_drvdata(dev);
+	struct tda998x_priv2 *priv =
+			container_of(priv_s, struct tda998x_priv2, base);
 
 	drm_connector_cleanup(&priv->connector);
 	drm_encoder_cleanup(&priv->encoder);
-- 
2.1.4


  parent reply	other threads:[~2015-01-20 19:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 19:35 [PATCH v10 0/9] ASoC: tda998x: add a codec to the HDMI transmitter Jean-Francois Moine
2015-01-19 17:15 ` [PATCH v10 1/9] ASoC: kirkwood: dynamically build the DAI array Jean-Francois Moine
2015-01-19 17:38 ` [PATCH v10 2/9] ASoC: kirkwood: check the DAI type from the DAI name Jean-Francois Moine
2015-01-19 18:50 ` [PATCH v10 3/9] ASoC: kirkwood: accept the DAI definitions from a graph of ports Jean-Francois Moine
2015-01-20  9:27 ` [PATCH v10 4/9] drm/i2c: tda998x: Add support of a DT " Jean-Francois Moine
2015-01-20 11:16 ` Jean-Francois Moine [this message]
2015-01-20 15:38 ` [PATCH v10 6/9] ASoC: tda998x: add a codec to the HDMI transmitter Jean-Francois Moine
2015-01-20 16:50 ` [PATCH v10 7/9] drm/i2c: tda998x: set cts_n according to the sample width Jean-Francois Moine
2015-01-20 18:47 ` [PATCH v10 8/9] ASoC: core: export snd_soc_get_dai_name Jean-Francois Moine
2015-01-20 19:16 ` [PATCH v10 9/9] ASoC: add generic dt-card support Jean-Francois Moine
2015-01-21 13:50   ` Mark Brown
2015-04-27 11:33 ` [PATCH v10 0/9] ASoC: tda998x: add a codec to the HDMI transmitter Jyri Sarha
2015-04-27 18:25   ` Jean-Francois Moine
2015-04-28  7:10     ` Jean-Francois Moine

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=ca8037eca1cbbec18d3917e9268735a88d6ff935.1421782533.git.moinejf@free.fr \
    --to=moinejf@free.fr \
    --cc=Andrew.Jackson@arm.com \
    --cc=airlied@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).