From patchwork Fri May 8 08:23:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 6882981 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 641689F380 for ; Tue, 28 Jul 2015 10:22:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92D1F20642 for ; Tue, 28 Jul 2015 10:22:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 681D2206B5 for ; Tue, 28 Jul 2015 10:21:59 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 556C3265794; Tue, 28 Jul 2015 12:21:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, FREEMAIL_FROM,NO_DNS_FOR_FROM,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B46ED2652E8; Tue, 28 Jul 2015 12:21:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 74B3626149E; Tue, 28 Jul 2015 12:21:05 +0200 (CEST) Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by alsa0.perex.cz (Postfix) with ESMTP id E9EE52606CB for ; Tue, 28 Jul 2015 12:20:57 +0200 (CEST) Received: from localhost (unknown [IPv6:2a01:e35:2f5c:9de0:21c:dfff:fe9f:57fb]) by smtp6-g21.free.fr (Postfix) with ESMTP id 640B682272; Tue, 28 Jul 2015 12:15:01 +0200 (CEST) X-Mailbox-Line: From 75f89593356cda2bad512015ff9ffdb19079a459 Mon Sep 17 00:00:00 2001 Message-Id: <75f89593356cda2bad512015ff9ffdb19079a459.1438076750.git.moinejf@free.fr> In-Reply-To: References: From: Jean-Francois Moine Date: Fri, 8 May 2015 10:23:24 +0200 To: Mark Brown , Russell King - ARM Linux Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Takashi Iwai , Andrew Jackson , Jyri Sarha , Dave Airlie Subject: [alsa-devel] [PATCH v14 2/3] drm/i2c: tda998x: Change drvdata for audio extension X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 0952eac..3504ef9 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1453,6 +1453,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; } @@ -1580,7 +1582,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); if (dev->of_node) crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); @@ -1639,7 +1641,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);