From: Stefan Mavrodiev <stefan@olimex.com>
To: Maxime Ripard <maxime@cerno.tech>, Stefan Mavrodiev <stefan@olimex.com>
Cc: Chen-Yu Tsai <wens@csie.org>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
open list <linux-kernel@vger.kernel.org>,
"open list:DRM DRIVERS FOR ALLWINNER A10"
<dri-devel@lists.freedesktop.org>,
"moderated list:ARM/Allwinner sunXi SoC support"
<linux-arm-kernel@lists.infradead.org>,
linux-sunxi@googlegroups.com
Subject: Re: [PATCH v3 1/1] drm: sun4i: hdmi: Add support for sun4i HDMI encoder audio
Date: Thu, 30 Jan 2020 08:20:55 +0200 [thread overview]
Message-ID: <64676a4b-e149-146c-81b4-7fd5e792efc5@olimex.com> (raw)
In-Reply-To: <20200129164321.34mornbi3xvx5dys@gilmour.lan>
Hi,
On 1/29/20 6:43 PM, Maxime Ripard wrote:
> 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 <drm/drm_print.h>
>> #include <drm/drm_probe_helper.h>
>>
>> +#include <sound/soc.h>
>> +
>> #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.
For me it's unnatural to have sound card all the time, even when the HDMI
is not plugged-in.
I'll follow your suggestion. Besides it's easier for me just to drop this
register/unregister mechanism.
Best regards,
Stefan Mavrodiev
>
> To fix the drvdata pointer, you just need to use the card pointer in
> the unbind, and that's it.
>
> Maxime
next prev parent reply other threads:[~2020-01-30 6:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-28 14:06 [PATCH v3 0/1] Add support for sun4i HDMI audio Stefan Mavrodiev
2020-01-28 14:06 ` [PATCH v3 1/1] drm: sun4i: hdmi: Add support for sun4i HDMI encoder audio Stefan Mavrodiev
2020-01-29 16:34 ` [linux-sunxi] " Chen-Yu Tsai
2020-02-25 9:45 ` Stefan Mavrodiev
2020-02-25 9:58 ` Maxime Ripard
2020-02-25 10:01 ` Stefan Mavrodiev
2020-01-29 16:43 ` Maxime Ripard
2020-01-30 6:20 ` Stefan Mavrodiev [this message]
2020-02-03 12:23 ` Maxime Ripard
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=64676a4b-e149-146c-81b4-7fd5e792efc5@olimex.com \
--to=stefan@olimex.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=maxime@cerno.tech \
--cc=wens@csie.org \
/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
all inboxes | Powered by JetHome®