From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 006F7C33CB8 for ; Wed, 22 Jan 2020 08:46:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBAED24672 for ; Wed, 22 Jan 2020 08:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579682782; bh=AepTZQnS41aFGnPgtfnFssNsH20gZiJLcFaGD27PRV0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=cYOuyYrSmDhdteQcWUA2MDVixBJsB87YNec5TGGvPMCOufpioCRBYfu56Q6XNMiMJ mrfzyhGNh3/N9EgB4Idhi8MbqbE3ORYo0QPCZkiNGXeDjU7vHEpX7jToHGeB+7D9FH mStGu2Dw3uPVBkOu/a2eOd+ZfDHc86IJfEF90jw8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729203AbgAVIqW (ORCPT ); Wed, 22 Jan 2020 03:46:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:45216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbgAVIqV (ORCPT ); Wed, 22 Jan 2020 03:46:21 -0500 Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 412962465A; Wed, 22 Jan 2020 08:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579682780; bh=AepTZQnS41aFGnPgtfnFssNsH20gZiJLcFaGD27PRV0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lKE/jqr5coHc/wWfyg1XVzfBMwoTN0AhXWs9DT60kBanKLjyBiFKr2fllB1806A74 +Rr8FQ5616OSPdnCwWeNrWpuI1lXV/wnZDKg0ZJtiGrakIj12v0wYeNSe7WEiV7AHQ 6vIdT8z4Tfao3vHQoSBrDVNtmR0OUVIwCurppQHU= Date: Wed, 22 Jan 2020 09:46:17 +0100 From: Maxime Ripard To: Mark Brown Cc: Stefan Mavrodiev , Dan Williams , Vinod Koul , Chen-Yu Tsai , David Airlie , Daniel Vetter , open list , "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , "moderated list:ARM/Allwinner sunXi SoC support" , "open list:DRM DRIVERS FOR ALLWINNER A10" , linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 2/2] drm: sun4i: hdmi: Add support for sun4i HDMI encoder audio Message-ID: <20200122084617.s2n4dqhwanmaxuch@gilmour.lan> References: <20200120123326.30743-1-stefan@olimex.com> <20200120123326.30743-3-stefan@olimex.com> <20200121182905.pxs72ojqx5fz2gi3@gilmour.lan> <20200121182937.2ak72e4eklk4za2u@gilmour.lan> <20200121183247.GL4656@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eo44jwmgblwjtd3w" Content-Disposition: inline In-Reply-To: <20200121183247.GL4656@sirena.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --eo44jwmgblwjtd3w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 21, 2020 at 06:32:47PM +0000, Mark Brown wrote: > On Tue, Jan 21, 2020 at 07:29:37PM +0100, Maxime Ripard wrote: > > > > Mark, our issue here is that we have a driver tied to a device that is > > > an HDMI encoder. Obviously, we'll want to register into DRM, which is > > > what we were doing so far, with the usual case where at remove / > > > unbind time, in order to free the resources, we just retrieve our > > > pointer to our private structure using the device's drvdata. > > > > Now, snd_soc_register_card also sets that pointer to the card we try > > > to register, which is problematic. It seems that it's used to handle > > > suspend / resume automatically, which in this case would be also not > > > really fit for us (or rather, we would need to do more that just > > > suspend the audio part). > > There's a drvdata field in the snd_soc_card for cases like this - would > that work for you? Ah, right, we could just retrieve the snd_soc_card in the unbind, and the retrieve our structure that way. That's pretty simple :) Stefan, I guess this is the easiest solution, we should just make sure that there's a comment to explain why we retrieve snd_soc_card in the unbind, since it's somewhat unusual. Thanks! Maxime --eo44jwmgblwjtd3w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXigL2QAKCRDj7w1vZxhR xWq1AP43hh7O1drKmKw4LWDcFL1e3jFnbiNLxBGwUtUAsT8hwwEA505uGh0lTCPZ 1dpI8BQYcJ5Zzjp9JGkU9Pm1KCyZMQA= =vZhm -----END PGP SIGNATURE----- --eo44jwmgblwjtd3w--