From patchwork Fri Oct 25 13:30:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-yi Chiang X-Patchwork-Id: 11214969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2CF8139A for ; Mon, 28 Oct 2019 08:24:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA179208C0 for ; Mon, 28 Oct 2019 08:24:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA179208C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D60B6E480; Mon, 28 Oct 2019 08:23:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E9876EA32 for ; Fri, 25 Oct 2019 13:30:42 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id s17so1244549plp.6 for ; Fri, 25 Oct 2019 06:30:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cSyCYud2FH3n+k9xbUM5DyhXCO7gVkxyPIn3KZPMoVk=; b=Ipdbfs/fWsthpSRYdddpPxoK8vrmPKcs8FtFFZmkOTHaoKx72Sm+ShvN6lqEHpDtZD QR4/RBiLPts1sTqurChZzLP495uBVqKVQXxswZQlIg98JFyriHY9rqivSsdhclv3jBx6 49+pjWqOO0BpdWk0+WXgTZcfYW/QxclOyzr2pGYqJauSm3Pb7DtOTU8oznDUGYDxNPCa aUCOya0DdgjWBkNQXJRdR0JbvDsUOim0XrrATa7Pp3rVZmSsaj4FdNP1rCc/Jham6dEx RBxjM1drybZoF0UbaD0eqD0xewCuPnZx3PmIze5iS3QYvFGbSoH6hwaYXBeb6j3+Z9XJ C31Q== X-Gm-Message-State: APjAAAVvJ/seynYS772j9g7IhA7g9q5R4+RHWM3Kq9RuLNv5iuxgTSkj GzTgEdWWxlbpCXUFI/PN8yR/dA== X-Google-Smtp-Source: APXvYqycQHeVv2f79P4vAiHHa3Pb9F7SMzCFxXTSqpZwuyvYWP563v5bjWFJjMgio5zv8hLxW+r38w== X-Received: by 2002:a17:902:ab89:: with SMTP id f9mr3842331plr.295.1572010241727; Fri, 25 Oct 2019 06:30:41 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:79b4:bd83:e4a5:a720]) by smtp.gmail.com with ESMTPSA id p2sm384312pfn.140.2019.10.25.06.30.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Oct 2019 06:30:41 -0700 (PDT) From: Cheng-Yi Chiang To: linux-kernel@vger.kernel.org Subject: [PATCH v8 2/6] ASoC: rockchip-max98090: Support usage with and without HDMI Date: Fri, 25 Oct 2019 21:30:03 +0800 Message-Id: <20191025133007.11190-3-cychiang@chromium.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog In-Reply-To: <20191025133007.11190-1-cychiang@chromium.org> References: <20191025133007.11190-1-cychiang@chromium.org> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Oct 2019 08:23:53 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cSyCYud2FH3n+k9xbUM5DyhXCO7gVkxyPIn3KZPMoVk=; b=ALs7cBkQVNo8Fjg8m921Llfxbt4MVCf1rdkYs1AcXTM9C09gmEnNUXT7yWsplEi+Mf Fyejp8alA8EbzYFsN56GPkbqtFESHfu6RZQUVFLVTT3/korWMFAnqfvBBovvWHUxiL25 PgbWjppTeshaG6YvdyZkW8o7x6NOK7A5YAYGI= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , alsa-devel@alsa-project.org, Neil Armstrong , David Airlie , dri-devel@lists.freedesktop.org, Liam Girdwood , Hans Verkuil , Laurent Pinchart , Jerome Brunet , Takashi Iwai , linux-rockchip@lists.infradead.org, dgreid@chromium.org, Cheng-Yi Chiang , devicetree@vger.kernel.org, tzungbi@chromium.org, Jonas Karlman , Russell King , Rob Herring , Jaroslav Kysela , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , dianders@chromium.org, Mark Brown Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There will be multiple boards sharing this machine driver. Use compatible string to specify the use case. "rockchip,rockchip-audio-max98090" for max98090-only. "rockchip,rockchip-audio-hdmi" for HDMI-only "rockchip,rockchip-audio-max98090-hdmi" for max98090 plus Move these properties to optional because they are not needed for HDMI-only use case. "rockchip,audio-codec": The phandle of the MAX98090 audio codec "rockchip,headset-codec": The phandle of Ext chip for jack detection The machine driver change will add support for HDMI codec in rockchip-max98090. Add one optional property "rockchip,hdmi-codec" to let user specify HDMI device node in DTS so machine driver can find hdmi-codec device node for codec DAI. Signed-off-by: Cheng-Yi Chiang --- .../bindings/sound/rockchip-max98090.txt | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/rockchip-max98090.txt b/Documentation/devicetree/bindings/sound/rockchip-max98090.txt index a805aa99ad75..75f438741ca6 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-max98090.txt +++ b/Documentation/devicetree/bindings/sound/rockchip-max98090.txt @@ -1,15 +1,29 @@ ROCKCHIP with MAX98090 CODEC Required properties: -- compatible: "rockchip,rockchip-audio-max98090" +- compatible: Set this property to one of the strings below depending on the + usage on the board: + "rockchip,rockchip-audio-max98090" for max98090-only. + "rockchip,rockchip-audio-hdmi" for HDMI-only + "rockchip,rockchip-audio-max98090-hdmi" for max98090 plus HDMI. - rockchip,model: The user-visible name of this sound complex - rockchip,i2s-controller: The phandle of the Rockchip I2S controller that's connected to the CODEC -- rockchip,audio-codec: The phandle of the MAX98090 audio codec -- rockchip,headset-codec: The phandle of Ext chip for jack detection + +Optional properties: +- rockchip,audio-codec: The phandle of the MAX98090 audio codec. This is + required if compatible string is set to the one + with max98090. +- rockchip,headset-codec: The phandle of Ext chip for jack detection. This is + required if compatible string is set to the one + with max98090. +- rockchip,hdmi-codec: The phandle of HDMI device for HDMI codec. This is + required if compatible string is set to the one with + HDMI. Example: +/* For max98090-only board. */ sound { compatible = "rockchip,rockchip-audio-max98090"; rockchip,model = "ROCKCHIP-I2S"; @@ -17,3 +31,21 @@ sound { rockchip,audio-codec = <&max98090>; rockchip,headset-codec = <&headsetcodec>; }; + +/* For HDMI-only board. */ +sound { + compatible = "rockchip,rockchip-audio-hdmi"; + rockchip,model = "ROCKCHIP-I2S"; + rockchip,i2s-controller = <&i2s>; + rockchip,hdmi-codec = <&hdmi>; +}; + +/* For max98090 plus HDMI board. */ +sound { + compatible = "rockchip,rockchip-audio-max98090-hdmi"; + rockchip,model = "ROCKCHIP-I2S"; + rockchip,i2s-controller = <&i2s>; + rockchip,audio-codec = <&max98090>; + rockchip,headset-codec = <&headsetcodec>; + rockchip,hdmi-codec = <&hdmi>; +};