From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH 1/9] drm: bridge/dw_hdmi-ahb-audio: add audio driver Date: Tue, 6 Oct 2015 19:18:07 +0100 Message-ID: <20151006181806.GS21513@n2100.arm.linux.org.uk> References: <20150808160936.GN7557@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Fabio Estevam Cc: Fabio Estevam , "alsa-devel@alsa-project.org" , linux-kernel , DRI mailing list , Jaroslav Kysela , linux-rockchip@lists.infradead.org, Mark Brown , Andy Yan , "linux-arm-kernel@lists.infradead.org" List-Id: alsa-devel@alsa-project.org T24gVHVlLCBPY3QgMDYsIDIwMTUgYXQgMDM6MDc6NDBQTSAtMDMwMCwgRmFiaW8gRXN0ZXZhbSB3 cm90ZToKPiBPbiBTYXQsIEF1ZyA4LCAyMDE1IGF0IDE6MTAgUE0sIFJ1c3NlbGwgS2luZwo+IDxy bWsra2VybmVsQGFybS5saW51eC5vcmcudWs+IHdyb3RlOgo+ID4gQWRkIEFMU0EgYmFzZWQgSERN SSBBSEIgYXVkaW8gZHJpdmVyIGZvciBkd19oZG1pLiAgVGhlIG9ubHkgYnVmZmVyCj4gPiBmb3Jt YXQgc3VwcG9ydGVkIGJ5IHRoZSBoYXJkd2FyZSBpcyBpdHMgb3duIHNwZWNpYWwgSUVDOTU4IGJh c2VkIGZvcm1hdCwKPiA+IHdoaWNoIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggYW55IEFMU0EgZm9y bWF0LiAgVG8gYXZvaWQgZG9pbmcgdG9vIG11Y2gKPiA+IGRhdGEgbWFuaXB1bGF0aW9uIHdpdGhp biB0aGUgZHJpdmVyLCB3ZSBzdXBwb3J0IG9ubHkgQUxTQXMgSUV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0aGVyLgoKSSBndWVzcyB0aGUgdGhpbmcgdG8gc3RhcnQg bG9va2luZyBhdCBpcyB3aGV0aGVyIHRoZSBkZXZpY2UgYW5kIGRyaXZlcgphcHBlYXIgaW4gL3N5 cy9idXMvcGxhdGZvcm0ve2RldmljZXMsZHJpdmVyc30vLiAgWW91IHNob3VsZCBoYXZlOgoKL3N5 cy9idXMvcGxhdGZvcm0vZGV2aWNlcy9kdy1oZG1pLWFoYi1hdWRpby4wLmF1dG8gCi9zeXMvYnVz L3BsYXRmb3JtL2RyaXZlcnMvZHctaGRtaS1haGItYXVkaW8KCmFuZCBvYnZpb3VzbHkgdGhlIGxh dHRlciBzaG91bGQgY29udGFpbiB0aGUgc3ltbGluayB0byB0aGUgZGV2aWNlLiAgSWYKdGhhdCBp cyBwcmVzZW50LCB0aGVuIHRoZSBkcml2ZXIgaGFzIGJvdW5kLCBhbmQgaXQgc2hvdWxkIGFwcGVh ciBpbgovcHJvYy9hc291bmQvY2FyZHMuCgotLSAKRlRUQyBicm9hZGJhbmQgZm9yIDAuOG1pbGUg bGluZTogY3VycmVudGx5IGF0IDkuNk1icHMgZG93biA0MDBrYnBzIHVwCmFjY29yZGluZyB0byBz cGVlZHRlc3QubmV0LgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fXwpkcmktZGV2ZWwgbWFpbGluZyBsaXN0CmRyaS1kZXZlbEBsaXN0cy5mcmVlZGVza3RvcC5v cmcKaHR0cDovL2xpc3RzLmZyZWVkZXNrdG9wLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2RyaS1kZXZl bAo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Tue, 6 Oct 2015 19:18:07 +0100 Subject: [PATCH 1/9] drm: bridge/dw_hdmi-ahb-audio: add audio driver In-Reply-To: References: <20150808160936.GN7557@n2100.arm.linux.org.uk> Message-ID: <20151006181806.GS21513@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Oct 06, 2015 at 03:07:40PM -0300, Fabio Estevam wrote: > On Sat, Aug 8, 2015 at 1:10 PM, Russell King > wrote: > > Add ALSA based HDMI AHB audio driver for dw_hdmi. The only buffer > > format supported by the hardware is its own special IEC958 based format, > > which is not compatible with any ALSA format. To avoid doing too much > > data manipulation within the driver, we support only ALSAs IEC958 LE and > > 24-bit PCM formats for 2 to 6 channels, which we convert to its hardware > > format. > > > > A more desirable solution would be to have this conversion in userspace, > > but ALSA does not appear to allow such transformations outside of > > libasound itself. > > > > Signed-off-by: Russell King > > I applied this series, but the HDMI audio card is not registered. I > guess I missed the dts pieces. Are the dts patches available? Sorry, I've been out for most of the day. There's no DT patches required. The dw_hdmi bridge driver creates its own platform device for the audio, which should then bind to the dw_hdmi-ahb-audio driver using normal Linux methods. I don't know what's wrong with your setup, for me, it just works: [ 1.358829] dwhdmi-imx 120000.hdmi: Detected HDMI controller 0x13:0xa:0xa0:0xc1 [ 1.377173] imx-drm display-subsystem: bound 120000.hdmi (ops dw_hdmi_imx_ops) ... [ 2.851343] ALSA device list: [ 2.857364] #0: DW-HDMI rev 0x0a, irq 21 as it always has done for me. There's nothing special about it. There's nothing special about it - it's a standard ALSA PCM audio driver, it doesn't have any requirements over and above having ALSA and ALSA's PCM support enabled. If you didn't have those enabled, but somehow had the dw_hdmi-ahb-audio set as built-in, you'd get a link time error, so it's not a configuration issue. It works for me on all iMX6 platforms (solo, dual-lite, dual and quad). As it's a straight ALSA device, it doesn't need any codec or any of the ASoC infrastructure either. I guess the thing to start looking at is whether the device and driver appear in /sys/bus/platform/{devices,drivers}/. You should have: /sys/bus/platform/devices/dw-hdmi-ahb-audio.0.auto /sys/bus/platform/drivers/dw-hdmi-ahb-audio and obviously the latter should contain the symlink to the device. If that is present, then the driver has bound, and it should appear in /proc/asound/cards. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752865AbbJFSSY (ORCPT ); Tue, 6 Oct 2015 14:18:24 -0400 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:43376 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbbJFSSX (ORCPT ); Tue, 6 Oct 2015 14:18:23 -0400 Date: Tue, 6 Oct 2015 19:18:07 +0100 From: Russell King - ARM Linux To: Fabio Estevam Cc: linux-rockchip@lists.infradead.org, "alsa-devel@alsa-project.org" , DRI mailing list , linux-kernel , "linux-arm-kernel@lists.infradead.org" , Fabio Estevam , Jaroslav Kysela , Mark Brown , Yakir Yang , Andy Yan Subject: Re: [PATCH 1/9] drm: bridge/dw_hdmi-ahb-audio: add audio driver Message-ID: <20151006181806.GS21513@n2100.arm.linux.org.uk> References: <20150808160936.GN7557@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2015 at 03:07:40PM -0300, Fabio Estevam wrote: > On Sat, Aug 8, 2015 at 1:10 PM, Russell King > wrote: > > Add ALSA based HDMI AHB audio driver for dw_hdmi. The only buffer > > format supported by the hardware is its own special IEC958 based format, > > which is not compatible with any ALSA format. To avoid doing too much > > data manipulation within the driver, we support only ALSAs IEC958 LE and > > 24-bit PCM formats for 2 to 6 channels, which we convert to its hardware > > format. > > > > A more desirable solution would be to have this conversion in userspace, > > but ALSA does not appear to allow such transformations outside of > > libasound itself. > > > > Signed-off-by: Russell King > > I applied this series, but the HDMI audio card is not registered. I > guess I missed the dts pieces. Are the dts patches available? Sorry, I've been out for most of the day. There's no DT patches required. The dw_hdmi bridge driver creates its own platform device for the audio, which should then bind to the dw_hdmi-ahb-audio driver using normal Linux methods. I don't know what's wrong with your setup, for me, it just works: [ 1.358829] dwhdmi-imx 120000.hdmi: Detected HDMI controller 0x13:0xa:0xa0:0xc1 [ 1.377173] imx-drm display-subsystem: bound 120000.hdmi (ops dw_hdmi_imx_ops) ... [ 2.851343] ALSA device list: [ 2.857364] #0: DW-HDMI rev 0x0a, irq 21 as it always has done for me. There's nothing special about it. There's nothing special about it - it's a standard ALSA PCM audio driver, it doesn't have any requirements over and above having ALSA and ALSA's PCM support enabled. If you didn't have those enabled, but somehow had the dw_hdmi-ahb-audio set as built-in, you'd get a link time error, so it's not a configuration issue. It works for me on all iMX6 platforms (solo, dual-lite, dual and quad). As it's a straight ALSA device, it doesn't need any codec or any of the ASoC infrastructure either. I guess the thing to start looking at is whether the device and driver appear in /sys/bus/platform/{devices,drivers}/. You should have: /sys/bus/platform/devices/dw-hdmi-ahb-audio.0.auto /sys/bus/platform/drivers/dw-hdmi-ahb-audio and obviously the latter should contain the symlink to the device. If that is present, then the driver has bound, and it should appear in /proc/asound/cards. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.