Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp732597ybl; Wed, 29 Jan 2020 08:45:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwvr8zZ7pEZwtPIltbOJjl3K09EAiiRJQs3iEsQZA3GKJCORiiJggO+d/yVug4frAnr4JcM X-Received: by 2002:a9d:3a65:: with SMTP id j92mr105778otc.37.1580316329976; Wed, 29 Jan 2020 08:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580316329; cv=none; d=google.com; s=arc-20160816; b=Fs7xlsftLd1W2yZ+YIkT0bNyS4GIIW5lH2F1qrBw3oBRTCCwPcBXGiRbLv/7qYByOH rBdNKX+kMrsw4/BmbNoKZVBx83HvgoA0GfqplSpK0Bc7EdImWWF5JUKwYhMzsZZ9lrgZ HtEH8gYkwrB5K0Cv2hyMbFgv9tY1iRP4lwJhz9tmdm364tMy4VdnByRSppMyf5Ae80lU rHtgQpHmU7zQW3fFs/pVUPTqfajFoJVlJo03xKoc3eEDBHGsQ7XzNLKHfUdC49Xj1Mk6 rlAQzZmtZuk7cf0kMI+HV2tQou2+iFUuAg0HIOR3i9KbT+pn7IWG42hj7I1MK/HDy+jO bg6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=wVzq7A1mRlnA44nVMIvtmOwiqIc+jpFRZC1MsfkyksU=; b=J2AahkwiqR94YHYKbT/fhJkQO+h4aBsCZd5VSrPVYkRFv22EQGCiMqLWZepe4+DghG uol/cXGG1mbFIbeuSfjSQU80ny21rINy7NugCSe6Czsopb+g0SOEYlKp9RuJwbtjwHB1 xDhWo9Yt9qH87v/cnsQhUWlO2ic6VmZp+qkfh3O4xUsdk8ojdrZXY9Zl+4cz0QYq/Cns lsrs9b+fCMe1Pv2OpS6Kx/4xFCxmOHs7JmTmbpsNHXkFeciBCRcq23RT7fx9Xfz1xwER 40/m73ova+8M8AfkEsqaq17tY5osLfIU8kueDXYknBDe3sCsyZPyxXpbln/SmdpZ01dA Lxqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=VthOtP0D; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=qqytq1Yf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si1395940oth.233.2020.01.29.08.45.17; Wed, 29 Jan 2020 08:45:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=VthOtP0D; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=qqytq1Yf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbgA2Qn0 (ORCPT + 99 others); Wed, 29 Jan 2020 11:43:26 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:40511 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgA2Qn0 (ORCPT ); Wed, 29 Jan 2020 11:43:26 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E8A8073A; Wed, 29 Jan 2020 11:43:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 29 Jan 2020 11:43:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=wVzq7A1mRlnA44nVMIvtmOwiqIc +jpFRZC1MsfkyksU=; b=VthOtP0DvyThBwtvX6HaFcbEMTcSArV4Azqiv8KpPlD 50QKi/8mlb2CCFnvsKBl1sLQYzejzFwOzg53M+fo3tndBhFTG58xStEyKTu5FCQH mrP+vFew0q+304HhwRf0hZaS9IXsnKVsMnEkg+eslmhGPeaVvL7wqq97VYtBHXmI KIfDEuglk2ZvNRcNnwynNy/NqfNgnheN5TnuZpOM87ZUvQqZo1irT+suVx/d+t0i N+FxgG7oOmHW4cwAFub2wg+GNxf/2gzKrOGPvcaLzT1X7Iq41LimQJeYz8m6ab2S iQBARgG9hJUbfIgdstm7Z06X+CxVGUbSafW4dHCgVdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=wVzq7A 1mRlnA44nVMIvtmOwiqIc+jpFRZC1MsfkyksU=; b=qqytq1Yf31pUWzGdkKoti4 Ov3jOUxIbpFlDCoJapv/9+GsHth0RMKmc34TB1zE7RjKgDm/7LU4puM630p0rC+R fZqoXn+0hZvktfbhzDeYJUx3Pm4NdiBkXzQjI7UVQZEgzbytALwfyseOxZ4+zRkz 5PwdhI56hqtwD/qh9kXtSCjJTc8vr9L1a3BEgKltoKa6THTNijP2kPDV9uMIe5NQ rJUt6RwxGeamRrJZaKDfPZDY8pwZ2S34YUoeGhLJgqddlcuAfhDUglC2CjMtymRZ WmQXUOjbUiSBtSBwcv+HqxyQ0KW9AYf/32c+fcCe4gv+286by/b9XkcmLzn6KXoQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrfeeigdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C10B3060B27; Wed, 29 Jan 2020 11:43:23 -0500 (EST) Date: Wed, 29 Jan 2020 17:43:21 +0100 From: Maxime Ripard To: Stefan Mavrodiev Cc: Chen-Yu Tsai , David Airlie , Daniel Vetter , open list , "open list:DRM DRIVERS FOR ALLWINNER A10" , "moderated list:ARM/Allwinner sunXi SoC support" , linux-sunxi@googlegroups.com Subject: Re: [PATCH v3 1/1] drm: sun4i: hdmi: Add support for sun4i HDMI encoder audio Message-ID: <20200129164321.34mornbi3xvx5dys@gilmour.lan> References: <20200128140642.8404-1-stefan@olimex.com> <20200128140642.8404-2-stefan@olimex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200128140642.8404-2-stefan@olimex.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jan 28, 2020 at 04:06:42PM +0200, Stefan Mavrodiev wrote: > diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c > index 68d4644ac2dc..4cd35c97c503 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c > +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c > @@ -23,6 +23,8 @@ > #include > #include > > +#include > + > #include "sun4i_backend.h" > #include "sun4i_crtc.h" > #include "sun4i_drv.h" > @@ -87,6 +89,10 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder) > > DRM_DEBUG_DRIVER("Disabling the HDMI Output\n"); > > +#ifdef CONFIG_DRM_SUN4I_HDMI_AUDIO > + sun4i_hdmi_audio_destroy(hdmi); > +#endif > + > val = readl(hdmi->base + SUN4I_HDMI_VID_CTRL_REG); > val &= ~SUN4I_HDMI_VID_CTRL_ENABLE; > writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG); > @@ -114,6 +120,11 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder) > val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE; > > writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG); > + > +#ifdef CONFIG_DRM_SUN4I_HDMI_AUDIO > + if (hdmi->hdmi_audio && sun4i_hdmi_audio_create(hdmi)) > + DRM_ERROR("Couldn't create the HDMI audio adapter\n"); > +#endif I really don't think we should be creating / removing the audio card at enable / disable time. To fix the drvdata pointer, you just need to use the card pointer in the unbind, and that's it. Maxime