Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp448283ybl; Tue, 28 Jan 2020 06:09:32 -0800 (PST) X-Google-Smtp-Source: APXvYqz9JMdRBS84eLM7jmlCjZv6/0Bfme97R6qFM1ToxaOQGXUII/O9unk18ISyl4Ibew4pIZBW X-Received: by 2002:a9d:7cd0:: with SMTP id r16mr17104048otn.50.1580220572765; Tue, 28 Jan 2020 06:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580220572; cv=none; d=google.com; s=arc-20160816; b=G8KzxitZdCNQ/yjD/3utoIRTpRAX4qHtMGh6OoaEFmzr5LYyTznI/FzwCFOEpWabfa KhCxaarXio6BE2mqNMiEk720wsvgIC9uH1M/59Rwj1t0fIkGASgzT4yBsMxBt75UMhv0 ET55BFz4/wXPt6hYV0Ymnz3/jb8YQ4xXuHzuvYM7ko8ajHKJXjclNHhhamwEu4shVY+i 40/ImqhgxUT+AsPmQmAUwlyKrtHtHMh2NsvgcE/AVPa5ByaMfPqNXM5uhYjYj3fSukYJ op5+vTc4TA4zZB0pl8ONazhzK1/aWTMZi7O3N+M0KO82nlIGwDp3uZOYMHwwv4VCpMQa H93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=YSSzrSJmvigqRPB0U6JdaE3Nh3H0JjqR3/KB6AZOtq4=; b=bUF0QhVoYEdxL3fcl4SdtUCbcREfR2uTvPtB3zDUhbFUrLkZAt0ji3NWNBsz9s7F4n GWlR+tC/TDRmHfWHgb3nzbEh5SQpCpXfOnHfmnGwWvEOMQ5aWyCM/R14I9819LloH5mf +AJ7162+9GxeP8Xv2D0SNu9wYAtPqRl5E5HY/ssPpyu6VnqvZW7oTiuNBOrrmlsB7ecI PmhmJ832ubhxgGsxq74sGPvS4eMU2CUS23lxiXEG5Mzix7+QNfqJy4MvVNW7lkVjZ+0G m9PZzRtgxmuVBBUxfNmMdPnSPww6uXkgasAXmZWWzIXmepV/L71+/1tA9uQHAed/EkPN i5lA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si4977192oiy.124.2020.01.28.06.09.12; Tue, 28 Jan 2020 06:09:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727873AbgA1OHD (ORCPT + 99 others); Tue, 28 Jan 2020 09:07:03 -0500 Received: from olimex.com ([184.105.72.32]:58579 "EHLO olimex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgA1OG5 (ORCPT ); Tue, 28 Jan 2020 09:06:57 -0500 Received: from localhost.localdomain ([94.155.250.134]) by olimex.com with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username stefan@olimex.com, mechanism PLAIN) for ; Tue, 28 Jan 2020 06:06:52 -0800 From: Stefan Mavrodiev To: Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list), dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR ALLWINNER A10), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support) Cc: linux-sunxi@googlegroups.com, Stefan Mavrodiev Subject: [PATCH v3 0/1] Add support for sun4i HDMI audio Date: Tue, 28 Jan 2020 16:06:41 +0200 Message-Id: <20200128140642.8404-1-stefan@olimex.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series add support for HDMI audio for sun4i HDMI encored. The code uses some parts from the Allwinners's BSP kernel. In the previous patch series there was additional patch enabling the cyclic DMA transfers. It was accepted, so it's omitted here. The patch is tested on A20 chip. For the other chips, only the addresses of the registers are checked. Changes for v3: - Dropped the patch which enable the cyclic DMA transfers - In v2, a separate platform_driver was created. However this is not practical and the idea is dropped. - Since this module depends on SND_SOC, a new Kconfig entry is added. When SND_SOC is not enabled, the audio part is not initialized. - The "big" issue with v1 was that snd_soc_register_card() overwrites the driver_data pointer. To resolve this issue, the original pointer is stored as drvdata of the card. Then before card unregistering, the pointer is restored. This is done by calling additional destroy function. Changes for v2: - Create a new platform driver instead of using the HDMI encoder - Expose a new kcontrol to the userspace holding the ELD data - Wrap all macro arguments in parentheses Stefan Mavrodiev (1): drm: sun4i: hdmi: Add support for sun4i HDMI encoder audio drivers/gpu/drm/sun4i/Kconfig | 11 + drivers/gpu/drm/sun4i/Makefile | 3 + drivers/gpu/drm/sun4i/sun4i_hdmi.h | 37 ++ drivers/gpu/drm/sun4i/sun4i_hdmi_audio.c | 450 +++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 14 + 5 files changed, 515 insertions(+) create mode 100644 drivers/gpu/drm/sun4i/sun4i_hdmi_audio.c -- 2.17.1