From patchwork Thu Nov 11 15:22:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1741 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 90BBE3F07B for ; Thu, 11 Nov 2021 16:23:02 +0100 (CET) Received: by mail-wm1-f72.google.com with SMTP id l187-20020a1c25c4000000b0030da46b76dasf4928372wml.9 for ; Thu, 11 Nov 2021 07:23:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636644182; cv=pass; d=google.com; s=arc-20160816; b=kUFJiBCPA4bxD5yMH5h+yfQKDCkgBNPe/x76LZQfwelGP0zsZkQRJZvi8UjmFi2WEg izIt0sVp92takO6qpuaBCZAFCFe8qXRe1aOEMGtezy4N/z1DgS8BF1TvOR5OXdQyxU/8 eIHNF4LrqOyzPBUa73MJQPxEnwADMu1G3qqY039JDpqwhwozHmC1HesJtYvcjHQ6OlWK 6M4xk5MYgyP9JYU1axS5hS8s6Yqql/i6/c3S0tGwO/iACi00UiKxRg7iYLnoDhPMbPL5 wCo8BOB507V8TEB9+JyADiHIBCNoljkKK/ftTt7KymHBDHPCjtMCDce/AKDd1Y2/5nzg uzeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=7lgjrWmUul4xxszYMpv7lOJm0kzuKZHmKmulHk1sPno=; b=Zw4576IvPCGQdf13eoHqzoasPm2xXLZMEXJuraayV7LSlS2tNlPXqv+RDFh4l7HOLf Bvbf51Gsz9CJP1VTkr+675jWfDISCSrX+GHg1EtVMkfk4ADOTbHj6Mtn0yDUjpF0ZICZ +x4FiYZ20zpF2WpoHdM1x8C0cJ/fkbmCV2Iak7vTJU18Ta6jwNl65m96IJCnGd2TiWng 1xii/0/gs5FQDmcRKFzSj3j2AjDwxFVQ4sUKohpXLKF5Bj6/9qPnssb0LZWBDXQXmXrs L0eSquwkBgeFBV7m+IH2jskr58dk0JhjAG5tj6JXoZ2MvJtqdpVncWnQBRXKWsRxLbEm Tn3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=atAz6vrL; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=7lgjrWmUul4xxszYMpv7lOJm0kzuKZHmKmulHk1sPno=; b=nkyXPnxfR7UK0JCoyHzg8OQV42ZAT/XRd//37lDTGpjOeRLofJSQYBEDGFrb84sKQ1 rp1PT6vGuMvY3qsic2SiVfVyW1uAaAq8d00AHPqnT9VIV49+SluutiEl7Yc0uQwgMpPY 31tioxtbH9GSJ0cYWGPsIgL5VtGQxdkPLKCPU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=7lgjrWmUul4xxszYMpv7lOJm0kzuKZHmKmulHk1sPno=; b=zLYCN/+NJzJfuYSs5ps6JQL5TCcGRQKjBqIffkmwR/PBtD3OzjvH0DlrYWBNo6Vxy6 q2KOjMyKngAscJsTcDh/J8d4tutex592HtsHnlCTffuLXAhmmhJiU+qEdTi/5bicEQvx ckUIAN7mKC25IbUX0u+XrITQg8Jsb36CfsIAF9+BcEMTd9on/RVzz6NGYx6gegCFJTbg 5fga0zCnksivvK8vwUp92Ntt8wvG1tv3PD3yfUPZhLcWHrwtXqY/tkHSrJZ089OtQF92 atV4BFEaqzAYlref9gmckXuFPU1JaE4uxRBKW2qP6+NQ9Z9ZxlLwhfSFI2FCFYVAsHr0 cPKQ== X-Gm-Message-State: AOAM533K00pWGZA4584Wne3OrWOS6xY5jA9W27VI6QzY6Hg6HRuQPZDM u2O6ywAy2bK0RFLvev5kSyNJL1cS X-Google-Smtp-Source: ABdhPJzQmN/38KlJ3l/6cZGrVPa3KkxuUhPXz/HxWOidHjTcjiHQsglP2rjXeLcU6b4fgnjhz3Oxaw== X-Received: by 2002:adf:eece:: with SMTP id a14mr9743933wrp.333.1636644182209; Thu, 11 Nov 2021 07:23:02 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:adf:f1c2:: with SMTP id z2ls2189734wro.2.gmail; Thu, 11 Nov 2021 07:23:01 -0800 (PST) X-Received: by 2002:adf:d852:: with SMTP id k18mr9207336wrl.391.1636644181141; Thu, 11 Nov 2021 07:23:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636644181; cv=none; d=google.com; s=arc-20160816; b=b5aH1HPoIWapC1CMEuj4XC1Mb/x2Br8X8yLSt0lZOnJ8OyCREP87HDY4kWqAFooTqO bogQDFmTQsdyGstb7rS5DGscEhHEm644VbVMa4VIB8/rqTmLkeUS1Na+dKBP2ljibr6u SL6GK/vtBPz9P09AeiSpiDUc2GQ0yNoYR9daTxScc8mRRBUkd3qnUEI7x0mNTMul3bso TcNtBSci8u5dmYazBLG84jVouf2d5rklBtkTj12trs2nY8O8ke8JgqNmA9o4EEMCdZRS 7DBf9JX/n1DZce3mSNG3hIs7v8Sjv9NZ7VRLGo9TweLnirVSLFih/F+CNmsq+N5TvDZV jgbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=JJrVXQwodsahwsr3DihtRK4ZJ7sSZSRHh2hhpiVwKVE=; b=aKY2jMoOBfXmRDFMKwWK2r896MUckHEZXOlezQdDNOETmIXTYRo+ikiU/0KlKEz75S R8DQYWfCs+RawVffX7YNJRjf7xBUBKSkvqSjqXFLfk9jPlPsSHFOXyfTtkHVeUHHaEw7 CuW+HEWh91gxfmUUQAHxOyNgATufuAYLaY7Fu+YfyOAkbG0rbGoy9zDOsumZaqEzior7 XZcyKKzjvPCDWLBCFKAWG1l+T+GqVMZwtmWiCX6UG5dUCseQAt0mt885Dge0PZbSAMzm wQJYgCUFV32iOIB7209G0IiBo0g5tJHCUi7p7Ad5GNQ5I8dfKqqC4IchZj5Y7QT4+9E1 7m2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=atAz6vrL; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 62sor2181495wrm.39.2021.11.11.07.23.01 for (Google Transport Security); Thu, 11 Nov 2021 07:23:01 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6000:12d2:: with SMTP id l18mr9896932wrx.289.1636644180650; Thu, 11 Nov 2021 07:23:00 -0800 (PST) Received: from panicking.pdxnet.pdxeng.ch ([5.171.215.77]) by smtp.gmail.com with ESMTPSA id f3sm8973683wmb.12.2021.11.11.07.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:23:00 -0800 (PST) From: Michael Trimarchi To: Ariel D'Alessandro Cc: linux-amarula@amarulasolutions.com, Anthony Brandon Subject: [PATCH 01/11] arm: dts: imx8ulz-smm-m2: Add BSH SMM-M2 IMX6ULZ System on Module Date: Thu, 11 Nov 2021 16:22:48 +0100 Message-Id: <20211111152258.26131-1-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=atAz6vrL; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add DTSI of BSH SMM-M2 System on Module in a basic version. This version comes with: - 256B of RAM, - Nand - wifi - bluetooth Signed-off-by: Michael Trimarchi --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/imx6ulz-smm-m2.dts | 176 +++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 arch/arm/boot/dts/imx6ulz-smm-m2.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 7e0934180724..f3efbc4311d0 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -678,6 +678,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \ imx6ull-phytec-segin-ff-rdk-nand.dtb \ imx6ull-phytec-segin-ff-rdk-emmc.dtb \ imx6ull-phytec-segin-lc-rdk-nand.dtb \ + imx6ulz-smm-m2.dts \ imx6ulz-14x14-evk.dtb dtb-$(CONFIG_SOC_IMX7D) += \ imx7d-cl-som-imx7.dtb \ diff --git a/arch/arm/boot/dts/imx6ulz-smm-m2.dts b/arch/arm/boot/dts/imx6ulz-smm-m2.dts new file mode 100644 index 000000000000..9068abf5289f --- /dev/null +++ b/arch/arm/boot/dts/imx6ulz-smm-m2.dts @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2020 BSH Hausgeraete GmbH + * + */ + +/dts-v1/; + +#include +#include "imx6ulz.dtsi" + +/ { + model = "BSH - SMM-M2"; + compatible = "bsh,smm-m2", "fsl,imx6ull"; + + chosen { + stdout-path = &uart4; + }; + + usdhc2_pwrseq: usdhc2_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&gpio2 21 GPIO_ACTIVE_LOW>; + status = "okay"; + }; + +}; + +&uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_bluetooth_uart>; + uart-has-rtscts; + /* not let depends the bluetooth on dma */ + /delete-property/dmas; + /delete-property/dma-names; + + status = "okay"; + + bluetooth { + compatible = "brcm,bcm4330-bt"; + max-speed = <3000000>; + shutdown-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + device-wakeup-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>; + host-wakeup-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>; + }; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_debug_uart>; + /delete-property/dma; + /delete-property/dma-names; + status = "okay"; +}; + +&usbotg1 { + dr_mode = "peripheral"; + srp-disable; + hnp-disable; + adp-disable; + status = "okay"; +}; + +&usbphy1 { + fsl,tx-d-cal = <106>; +}; + +&usdhc2 { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wlan>; + bus-width = <4>; + no-1-8-v; + non-removable; + cap-power-off-card; + pm-ignore-notify; + keep-power-in-suspend; + wifi-host; + cap-sdio-irq; + mmc-pwrseq = <&usdhc2_pwrseq>; + status = "okay"; + + brcmf: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&gpio1>; + interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "host-wake"; + }; +}; + +&wdog1 { + status = "okay"; +}; + +&gpmi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpmi_nand>; + status = "okay"; + nand-on-flash-bbt; +}; + +&tempmon { + status = "disabled"; +}; + +&iomuxc_snvs { + status = "disabled"; +}; + +&iomuxc { + pinctrl_bluetooth_uart: uart3grp { + fsl,pins = < + MX6UL_PAD_UART3_TX_DATA__UART3_DCE_TX 0x1b0b1 + MX6UL_PAD_UART3_RX_DATA__UART3_DCE_RX 0x1b099 + MX6UL_PAD_UART3_RTS_B__UART3_DCE_RTS 0x1b0b1 + MX6UL_PAD_UART3_CTS_B__UART3_DCE_CTS 0x1b099 + + MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0x79 /* BT_REG_ON */ + MX6UL_PAD_SD1_CLK__GPIO2_IO17 0x100b1 /* BT_DEV_WAKE out */ + MX6UL_PAD_ENET2_TX_EN__GPIO2_IO13 0x1b0b0 /* BT_HOST_WAKE in */ + >; + }; + + pinctrl_debug_uart: uart4grp { + fsl,pins = < + MX6UL_PAD_UART4_TX_DATA__UART4_DCE_TX 0x1b0b1 + MX6UL_PAD_UART4_RX_DATA__UART4_DCE_RX 0x1b0b1 + >; + }; + + pinctrl_gpmi_nand: gpmi-nand { + fsl,pins = < + MX6UL_PAD_NAND_CLE__RAWNAND_CLE 0xb0b1 + MX6UL_PAD_NAND_ALE__RAWNAND_ALE 0xb0b1 + MX6UL_PAD_NAND_WP_B__RAWNAND_WP_B 0xb0b1 + MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0xb000 + MX6UL_PAD_NAND_CE0_B__RAWNAND_CE0_B 0xb0b1 + MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0xb0b1 + MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0xb0b1 + MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0xb0b1 + MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0xb0b1 + MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0xb0b1 + MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0xb0b1 + MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04 0xb0b1 + MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05 0xb0b1 + MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06 0xb0b1 + MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0xb0b1 + >; + }; + + pinctrl_wlan: wlangrp { + fsl,pins = < + MX6UL_PAD_CSI_HSYNC__USDHC2_CMD 0x17059 + MX6UL_PAD_CSI_VSYNC__USDHC2_CLK 0x10059 + MX6UL_PAD_CSI_DATA00__USDHC2_DATA0 0x17059 + MX6UL_PAD_CSI_DATA01__USDHC2_DATA1 0x17059 + MX6UL_PAD_CSI_DATA02__USDHC2_DATA2 0x17059 + MX6UL_PAD_CSI_DATA03__USDHC2_DATA3 0x17059 + + MX6UL_PAD_SD1_DATA3__GPIO2_IO21 0x79 /* WL_REG_ON */ + MX6UL_PAD_UART2_CTS_B__GPIO1_IO22 0x100b1 /* WL_DEV_WAKE - WiFi_GPIO_4 - WiFi FW UART */ + MX6UL_PAD_UART1_CTS_B__GPIO1_IO18 0x1b0b1 /* WL_HOST_WAKE - WIFI_GPIO_0 - OOB IRQ */ + MX6UL_PAD_ENET1_RX_EN__OSC32K_32K_OUT 0x4001b031 /* OSC 32Khz wifi clk in */ + >; + }; + + pinctrl_bsh_dbus_sleep: uart1grp_sleep { + fsl,pins = < + MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0a1 /* UART mode allow wakeup */ + MX6UL_PAD_UART1_TX_DATA__GPIO1_IO16 0x1000 + MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14 0x1b0b0 /* DBUS_WKUP */ + MX6UL_PAD_GPIO1_IO05__GPIO1_IO05 0x1000 /* DBUS_IDLE */ + >; + }; +}; From patchwork Thu Nov 11 15:22:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1742 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 19D043F07B for ; Thu, 11 Nov 2021 16:23:04 +0100 (CET) Received: by mail-wr1-f70.google.com with SMTP id q17-20020adff791000000b00183e734ba48sf1065034wrp.8 for ; Thu, 11 Nov 2021 07:23:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636644183; cv=pass; d=google.com; s=arc-20160816; b=qbtSJLN0b1piLGa6X0O8Z1wP03gxJHtayaFbthS0b9aw1WCKC/BRu7rH+uAFWBLIcE 4U29E0uvoI2VSxp3dcTbcI6+AwJng3/of6QvCQMMLQbMZSZymXEd3o6p7abGwWOawYdK PXfwT4gS8uKKejfBLCNI0N2fVqXf1p6EyaNSnujdpufU1ApUb5eh+UEbbJ+1MF97uTGg sMQrs3OyJz9rDMB7Nw1shWvcfmr5MtAIYq01pXCAchxaADFUJf++EQsx4oiYn8NK3yTj d1xf1B9XTnFb5pOYEeEXSQVcfkkBE4U8+T8j8XLEgg0GhgfBsu5Qk5gjPUKUop/Au/Mr loDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dJGwW3VBknuY/4ZS/1PAfWU8h0RPGAgV9KcCzFkcVC8=; b=ojPus9B9fItYEO36puD431otaPr19wZRGTf6cck6K+T60WIdvJw+41g464XdqZ8XeP QhzmAiPlwOslQoSy2jZ76Hjv2OiK46PLR2ORJ05jDNDQYjqGaT9FT3EQlB1E3PumSHAA VfTQ9eTwV3p6VwcfC6wdViwKg9D9HVS+6sP+ctN3k68VCZQ+y+6XqAh4hkjjvRr/Rpsf EeWdBUn1/egYDiZMCtZnKRx62Ar4mNseGpAoez2wS/IO3qWN904aRrbKMjJehaiEFCJh mLJVIBypv1l8gyDmoaDjvIh5+R1xEEhidafug6OTirpHcrZ1MZGgOpi3DmwxlrfqgQrO hjpQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="p/mXwthC"; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=dJGwW3VBknuY/4ZS/1PAfWU8h0RPGAgV9KcCzFkcVC8=; b=M94kRXHCOpTe7Fqco3NGQXe7TNub5+QxuAlLigr8Xi20A7BzPiRS+sWeEIeNpXKgNW 3TnLbaJyXqyXieU5X1nPplFMjwwZNtP/tUXajKmtpD6rardHiSwD8pFr75G3XX0HuRz6 fFFJJn52zOKxHqQNjFjL8h/hWsRm0ujteQQ5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=dJGwW3VBknuY/4ZS/1PAfWU8h0RPGAgV9KcCzFkcVC8=; b=JaCzhDjEW0k7aVb/wzsJMYTCDIK9jqd1qCdgfoXBH/mDVmqmSdNbC5ZHPTBbe75p8T kfF/N+uoaKQAJu0cdAwU8IZkescTC88AfzrGPZf8lHqdStW6njwa9MDe3rSA8N7FWvEJ WrCcm+635JPn+Oz4emXd9vEklEMk82aJl20wpu7a5AiZbdJj7pTzLHnbZSBrL1XpoYwS Y8KVeNtYLSdngrOlQbOQkbOhy88Grj1Jab5dEd3tSszFzJNwGQuVG+yEn6H30PMRymV9 WxFigyLpvjINUiefb1F0NlSWetjBB1zpObugbxUws4cWAcPlfvfoCbzqsgOo6A0qrN01 6l+w== X-Gm-Message-State: AOAM530yaPFnDDbG/nRrg8ZgHtt2ItRZp52nonJkBXRmDFjo8PofI5UC zcyXR0y90sFbIBet1KEh5WzmY+Lu X-Google-Smtp-Source: ABdhPJyYi3s4Z3HXx02jBypb1U9jjW51w4jkA0ysvv2zHogZHeRrRVnghAC5uaMmXIpy87jKcXRajw== X-Received: by 2002:a5d:680b:: with SMTP id w11mr9827626wru.345.1636644183781; Thu, 11 Nov 2021 07:23:03 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:4092:: with SMTP id o18ls2187519wrp.1.gmail; Thu, 11 Nov 2021 07:23:02 -0800 (PST) X-Received: by 2002:a05:6000:1868:: with SMTP id d8mr9550155wri.285.1636644182787; Thu, 11 Nov 2021 07:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636644182; cv=none; d=google.com; s=arc-20160816; b=N+X7jQEvaZ0kpIW1IRGoZvlEAkTbgPN1jWsMD/zKVEY4M0p2kFxA3Xthk+3TGs18j6 8JOSME8ZEwypB7RnBgGf1DsJYVNxIhp72bXDDyQPv7Jb2G1oul0Q8OpTQHvut27V1dBN FlOi7kD8SD/OeZmg2iOv4kb+FthW0dEXEuI2Qfri5sUbCYWJkAm8gzWlYQ5Z1pxfhtUz TI66leGcSJy+g/NQtX645nKpIppslz95fDm1KwI0S95WHKEAK7s6yMwC9w0ufDvI32ib 22KayAx+XKmNSvEvOHl3lPwNL4OORC+tdv2cpDV1rgkhr9Ym9vbLk6yNRaL5nUfRRimI +JMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=d5uDcfWb9i0bf5/Bus/K1aJkyvR2P/nqkCsiQDRHFvs=; b=Hvk3KuM+nPDsdkFjct1jQrc/Q9D0LVr0udFwy6flIB7kCsx6c8aXKkIWl6TRXeeOLE GLMOT/yY1ofWn3KuZRw5/3Smhv6hd0FprKTqTIY9YmwO+/pgdOIwbmRfZL9mSckXVajy nWvYLGJzCt5fiQMdlq+phVxQZzyFT+w5s8aH4OMhwBsCQR4QY8bRQRdzJvuwrpAIMdTJ PaH6l0r7RT/dQgu8R8I01nuRi5xrqUFuVWp/bX9pV6bQeXrtO3UcNn5GKUNjtwCPyMjz TOUmjFL1aSTBbnydYvBGcndjgouNXAmbgCfFVnjRDrLMEk1t+zMeJk5uihrllDRha5BR 6Qxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="p/mXwthC"; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id d8sor2244229wri.16.2021.11.11.07.23.02 for (Google Transport Security); Thu, 11 Nov 2021 07:23:02 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6000:2a2:: with SMTP id l2mr9503502wry.110.1636644182485; Thu, 11 Nov 2021 07:23:02 -0800 (PST) Received: from panicking.pdxnet.pdxeng.ch ([5.171.215.77]) by smtp.gmail.com with ESMTPSA id f3sm8973683wmb.12.2021.11.11.07.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:23:01 -0800 (PST) From: Michael Trimarchi To: Ariel D'Alessandro Cc: linux-amarula@amarulasolutions.com, Anthony Brandon Subject: [PATCH 02/11] sound: soc: tlv320aic31xx: add rate divs for 12288000Hz Date: Thu, 11 Nov 2021 16:22:49 +0100 Message-Id: <20211111152258.26131-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211111152258.26131-1-michael@amarulasolutions.com> References: <20211111152258.26131-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="p/mXwthC"; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Anthony Brandon Signed-off-by: Anthony Brandon --- sound/soc/codecs/tlv320aic31xx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 52d2c968b5c0..6b54811be1ca 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -196,46 +196,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = { /* 8k rate */ {12000000, 8000, 8, 1920, 128, 48, 2, 128, 48, 2}, {12000000, 8000, 8, 1920, 128, 32, 3, 128, 32, 3}, + {12288000, 8000, 8, 0, 128, 48, 2, 128, 48, 2}, {12500000, 8000, 7, 8643, 128, 48, 2, 128, 48, 2}, /* 11.025k rate */ {12000000, 11025, 7, 5264, 128, 32, 2, 128, 32, 2}, {12000000, 11025, 8, 4672, 128, 24, 3, 128, 24, 3}, + {12288000, 11025, 7, 3500, 128, 32, 2, 128, 32, 2}, {12500000, 11025, 7, 2253, 128, 32, 2, 128, 32, 2}, /* 16k rate */ {12000000, 16000, 8, 1920, 128, 24, 2, 128, 24, 2}, {12000000, 16000, 8, 1920, 128, 16, 3, 128, 16, 3}, + {12288000, 16000, 8, 0, 128, 24, 2, 128, 24, 2}, {12500000, 16000, 7, 8643, 128, 24, 2, 128, 24, 2}, /* 22.05k rate */ {12000000, 22050, 7, 5264, 128, 16, 2, 128, 16, 2}, {12000000, 22050, 8, 4672, 128, 12, 3, 128, 12, 3}, + {12288000, 22050, 7, 3500, 128, 16, 2, 128, 16, 2}, {12500000, 22050, 7, 2253, 128, 16, 2, 128, 16, 2}, /* 32k rate */ {12000000, 32000, 8, 1920, 128, 12, 2, 128, 12, 2}, {12000000, 32000, 8, 1920, 128, 8, 3, 128, 8, 3}, + {12288000, 32000, 8, 0, 128, 12, 2, 128, 12, 2}, {12500000, 32000, 7, 8643, 128, 12, 2, 128, 12, 2}, /* 44.1k rate */ {12000000, 44100, 7, 5264, 128, 8, 2, 128, 8, 2}, {12000000, 44100, 8, 4672, 128, 6, 3, 128, 6, 3}, + {12288000, 44100, 7, 3500, 128, 8, 2, 128, 8, 2}, {12500000, 44100, 7, 2253, 128, 8, 2, 128, 8, 2}, /* 48k rate */ {12000000, 48000, 8, 1920, 128, 8, 2, 128, 8, 2}, {12000000, 48000, 7, 6800, 96, 5, 4, 96, 5, 4}, + {12288000, 48000, 8, 0, 128, 8, 2, 128, 8, 2}, {12500000, 48000, 7, 8643, 128, 8, 2, 128, 8, 2}, /* 88.2k rate */ {12000000, 88200, 7, 5264, 64, 8, 2, 64, 8, 2}, {12000000, 88200, 8, 4672, 64, 6, 3, 64, 6, 3}, + {12288000, 88200, 7, 3500, 64, 8, 2, 64, 8, 2}, {12500000, 88200, 7, 2253, 64, 8, 2, 64, 8, 2}, /* 96k rate */ {12000000, 96000, 8, 1920, 64, 8, 2, 64, 8, 2}, {12000000, 96000, 7, 6800, 48, 5, 4, 48, 5, 4}, + {12288000, 96000, 8, 0, 64, 8, 2, 64, 8, 2}, {12500000, 96000, 7, 8643, 64, 8, 2, 64, 8, 2}, /* 176.4k rate */ {12000000, 176400, 7, 5264, 32, 8, 2, 32, 8, 2}, {12000000, 176400, 8, 4672, 32, 6, 3, 32, 6, 3}, + {12288000, 176400, 7, 3500, 32, 8, 2, 32, 8, 2}, {12500000, 176400, 7, 2253, 32, 8, 2, 32, 8, 2}, /* 192k rate */ {12000000, 192000, 8, 1920, 32, 8, 2, 32, 8, 2}, {12000000, 192000, 7, 6800, 24, 5, 4, 24, 5, 4}, + {12288000, 192000, 8, 0, 32, 8, 2, 32, 8, 2}, {12500000, 192000, 7, 8643, 32, 8, 2, 32, 8, 2}, }; From patchwork Thu Nov 11 15:22:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1743 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 613B23F1C9 for ; Thu, 11 Nov 2021 16:23:05 +0100 (CET) Received: by mail-wm1-f71.google.com with SMTP id m1-20020a1ca301000000b003231d5b3c4csf4940952wme.5 for ; Thu, 11 Nov 2021 07:23:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636644185; cv=pass; d=google.com; s=arc-20160816; b=QhX8AwUAaNp8FDKDqTXih1FVABmPjT8JVGHqaKSY/ZQPIqtI8DbYF888BBfkaxdxG3 8CbBFiEsWA6+Bw3Daf6vX388K9nfHOuDCRz2hM7Sa8R8J5fy35PU1PwHhmb5gqH34kmd qa6B8CI1qQrb3v7fuZgFrSb0pt95lj4qGpz+P3NZo+2+XSJ/wntce1gXXkE16KH97vS/ /1/lBdF/J4xHmeml5TNi267ytIBeMxVAlPOblHCdSAK0M5HqVlPOnvzYdcP4foL6ty8B WEaKt31zKlRV8wnvAnkmv1d1WwIKG3G649cwAzXwC5CmP9kF6sZE1A00GCgxUB8InRTY +rUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pdYHbWbEL+JS8wUb9+QsAE3oPjA/sBi7kedKhmHbUjE=; b=AuGLO02wJU0vGBlbVumA6Fy17Wh1ozhT3CrhmksMJ6++lIeJwoRKQaka9RJ2IiBg6D NQwky9MHGTWlS2b0cc/4AklpxSNTkQ4Na6rPjjN9nlQwKzGYy/Pkmd9i8f8ILOFGhC+4 ogFeU7JRr6rJ89HC3JvKdCn+nV4Gmb5VrjbnwKWaS/7uURGa0UHieOZKG4hDmaHZ+wqL SAQCv2Ik/yAd4ZaFXnlw/ZRnb55IuD6jTld4U77O5S+INb/iyTDLaHRMfuLUXem0pBeB iPQGKv5FKyt2O0603z/qujnjULdZxK8Vc7to4/bXAt0peAZC56fnfeKTpQafRU9BcaSF UZsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SRkcD+dw; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=pdYHbWbEL+JS8wUb9+QsAE3oPjA/sBi7kedKhmHbUjE=; b=JSyWVG3qTEUZDU45vRWezbxJKQtgFGHQmLl8LDB6mtN6ILK7nc25TufF2ixlRzMaCB 12BLP/JJ5mniQPzbEv29Ua3caOaknbW/MOUo8VgTSy1xaTEHA9k/mnINiKtDJZbR24JC qQ/N0a+CEHJH4856w235IXz3FQ4CVOmpnrcvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=pdYHbWbEL+JS8wUb9+QsAE3oPjA/sBi7kedKhmHbUjE=; b=hvgRd+iMshi0XlZIHJ9P8qaSdKCJHsINXy4IwNBh6//0qvexDP8enuU2eYMBThPGyq fPrVPY5EZqmG9msVSTglKXnWzdhY3mOwCqIvng84zVcwpUvk/ImisH+ewMBLFTDYNlyA SVbwOdUMbaR89eYRh0AJ/OsF52KHPKz7SHNKCBYNwtYBuejepSABo98HjHi97ncCtJea bmoA3WePe5cehMsbItx/AwjEY3xjPA60UINY24gpYSrEFXrXnDkn7FkbcsLR9V7k21bs PlF/GGuUoUQYXpiF0AoaeuREYCApEn8eZGDjZNYDMcTcqVip/Ijwd19YlIxUCfvozWgO uxSg== X-Gm-Message-State: AOAM533iGZyG2owNx6h3YZup5/rSdM9SUI4U/Lx2QVWY57SRlLFqJa7N KTVT2q7KfKVl8ITzhBeFpbKqjXBP X-Google-Smtp-Source: ABdhPJxR1kn+cLzWNl5JZLEn1Cm6/8hcXKWD/OwWpS87/N/NeMrKKflP5QD/vf5o72o52b72tWcJpg== X-Received: by 2002:a1c:4b07:: with SMTP id y7mr9003320wma.188.1636644185141; Thu, 11 Nov 2021 07:23:05 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:4092:: with SMTP id o18ls2187643wrp.1.gmail; Thu, 11 Nov 2021 07:23:04 -0800 (PST) X-Received: by 2002:a05:6000:1a86:: with SMTP id f6mr9834044wry.230.1636644184187; Thu, 11 Nov 2021 07:23:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636644184; cv=none; d=google.com; s=arc-20160816; b=Qy0lZquEG8R2ENbGn9Q+1llhEUpzJnMiSZ2F9I4kpxl2MFieu/bG5LeGrGaGv3doOC vrsm9vQtjGbDo7lV7sxzB/XIMpTQ4RCg3ez+/CmW4O5o+vVMbDi7u7MSfIrwyVfwPpWn 0mZMbMFsBNfnf0T3frlCmthwUH4FZDBcnQAUQ4iCFGDd74OrBIIJavaAbr6ZkR4+cbcv 1d4mdDkCbiREuGpQj3MawYPmIUi0ayYJL0kDcr1jUhi7FXKS+Bi/Rt5xlbTVoHPdxsfw M67wfIUd8q8W8NWr+YCgeWrkmRITWUQbXr/xhHyR+/NoXUfP/zRKzvkKAHGKnOYaypv5 tMSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LUqM+ZTRp3sFgmttLvWHnCxJ6du4j1p6vWqNd4Mvz8o=; b=CTxq4r6vzpgtXk4Yu7p93UFsnSZMq/kFaEfFOzSG1Mw8C8mJ3a6A/28Z3laNLxSZLY clHGgJLV5O6LNlsx61ztPITef59SAAJeTOCGfcgbmj52rmuiRZxxNANhRTxxG/we5iQe TEwaR6RLDBbthy3drVXvppJMYmvkFNtEYLRoY+Im1R7w38cG+SMsKojNBqSE7fz+9S1S oQzLznFxvFofYV6urkSDApD9/33wRKUnd7fvAB+QiKNPZcYwEIcqptH4o1WpTToQxMG/ 0rATaU8a/QkC0dck852DJDlSKUuH7bho56h7qUIFbUYzqhvsW9H/SzZZTKBKQ3mXfqu6 dZLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SRkcD+dw; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id r15sor2307513wrq.29.2021.11.11.07.23.04 for (Google Transport Security); Thu, 11 Nov 2021 07:23:04 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a5d:4ed1:: with SMTP id s17mr9822339wrv.310.1636644183891; Thu, 11 Nov 2021 07:23:03 -0800 (PST) Received: from panicking.pdxnet.pdxeng.ch ([5.171.215.77]) by smtp.gmail.com with ESMTPSA id f3sm8973683wmb.12.2021.11.11.07.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:23:03 -0800 (PST) From: Michael Trimarchi To: Ariel D'Alessandro Cc: linux-amarula@amarulasolutions.com, Anthony Brandon Subject: [PATCH 03/11] soc: codecs: tlv320aic31xx: Add support for external optional clock mclk Date: Thu, 11 Nov 2021 16:22:50 +0100 Message-Id: <20211111152258.26131-3-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211111152258.26131-1-michael@amarulasolutions.com> References: <20211111152258.26131-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SRkcD+dw; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Need to be sure that clock connected to the codec is enable during the codec probe. Signed-off-by: Michael Trimarchi --- sound/soc/codecs/tlv320aic31xx.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 6b54811be1ca..f1a758fe07ce 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,7 @@ struct aic31xx_priv { u8 i2c_regs_status; struct device *dev; struct regmap *regmap; + struct clk *clk; enum aic31xx_type codec_type; struct gpio_desc *gpio_reset; int micbias_vg; @@ -1346,6 +1348,21 @@ static int aic31xx_codec_probe(struct snd_soc_component *component) aic31xx->component = component; + aic31xx->clk = devm_clk_get_optional(component->dev, "mclk"); + if (IS_ERR(aic31xx->clk)) { + dev_err(component->dev, "failed to get the clock: %ld\n", + PTR_ERR(aic31xx->clk)); + return -EINVAL; + } + + aic31xx->sysclk = clk_get_rate(aic31xx->clk); + + ret = clk_prepare_enable(aic31xx->clk); + if (ret) { + dev_err(component->dev, "unable to enable mclk\n"); + return ret; + } + for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) { aic31xx->disable_nb[i].nb.notifier_call = aic31xx_regulator_event; @@ -1380,8 +1397,16 @@ static int aic31xx_codec_probe(struct snd_soc_component *component) return 0; } +static void aic31xx_codec_remove(struct snd_soc_component *component) +{ + struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component); + + clk_disable_unprepare(aic31xx->clk); +} + static const struct snd_soc_component_driver soc_codec_driver_aic31xx = { .probe = aic31xx_codec_probe, + .remove = aic31xx_codec_remove, .set_jack = aic31xx_set_jack, .set_bias_level = aic31xx_set_bias_level, .controls = common31xx_snd_controls, From patchwork Thu Nov 11 15:22:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1744 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 45DA03F07B for ; Thu, 11 Nov 2021 16:23:07 +0100 (CET) Received: by mail-wm1-f71.google.com with SMTP id r6-20020a1c4406000000b0033119c22fdbsf2881354wma.4 for ; Thu, 11 Nov 2021 07:23:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636644187; cv=pass; d=google.com; s=arc-20160816; b=D/vB5JaBh7m0cRFrHnq2U955l7rkdSlG/39xMDnCZC4VZ8xD0jdTuSuVMdisNfBaY5 HcIrKP4Bk72o7TLxcjPdprP2JJJsAatWOAhyIF1UZkUvz7afKvZxD+xQ45sVmEFqfKkR xHuBGRl7RwRPAp67Cvky8HSVZ3R2MVa8AbYy1GGX2QuH7+OblkTViFIY5vS6r0oBlq4n oLINNLM0KjznOIxAQbISQQSzod0s8mRmQUZCDJUVNFKzdwvCLiDXPEwLJrcGWGpdao9c Q53A8J1RsGDlPxAvAbhER+OdAqlFKE9OM2a3ibs01OY1ky/ALY+yV/vKyTHar48kmJJO 9caQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=UZAND2P0f8ueuCfx9B+vIkjO629NAR7zp4sz5zNhdDY=; b=tj0gbtnrUcm9HslqVb7Knidw8tmn+YdwKzAB4/LeP+YADGmnm59rbELvJNg1ZB4U9g SAXJHzJh6MhjXvubrDV6dBniMP1IhgVWZ56U6DWDMuFSNDzaRt3Ubt41Z3IG2BPS6rFZ BmJ7kYMhGMwnSCaus7bZobXw4Ael/cQAWmqXQ0vAJjhHsBB7dY9BGAcU8wNGpyGjldi4 hbzDp6q7Y/1fKfTpKdp4inRQB/uyCyYZJnaJ92ggauLAi2DH8bgOQLtdYbZQZUrR0hEX swEQ+TUF4UbN9M605vfd/g66WsNwqMWfa+bZbHu9Qfa+Hz4Jx4RoCVH/J7C/flY6haFm /4zw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gans+dQh; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=UZAND2P0f8ueuCfx9B+vIkjO629NAR7zp4sz5zNhdDY=; b=fxrgWAiKougzKSdBcp3i8AVOPKbgMGLwMcnXvmeZwm3ADTc6i0VIUKwV6+F8JiDahH 8aE7+uavIeVhujtcq5oBOEwh/ckTwYn3VN7DjwRu+9DIjybTi0OuL2Cia99JByhnPiJ3 PAxeZNQe0JErHqiXU8MOSE1RhzTVKRPY9SgoE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=UZAND2P0f8ueuCfx9B+vIkjO629NAR7zp4sz5zNhdDY=; b=Cr8jUqqQMviAGkSq6OtJfi6W6tL+5muvMMgShnPBOh2Bl76Y81aZlE+6/m3UKA6p0d dEyDZ0qeHnXzbexEEnU8NtM2jKqcpv9R5gWGcfrWnaaCaO8aaJEjiehVTsB+LHA0P9t7 Qshn8VJxE6sHVI/s7oyEOQ7F01vFlXHoyuG3SoiLK6/lQNbKmBrzeUI4iBowBPG3vtgT 082NIBfJvlQ6yS82sw1IK0JLjmh73wL1ht+A71Hg+m8+W7kRgCrLLGs68lnhsXDKtVZ0 lDm3oKTOPH9g4TDCk6vlx/pQTh02rubTgitXCsgkMAG2Wamg05WTRVgWXTy7IWmre3s+ 15pw== X-Gm-Message-State: AOAM533mFZzPJqT/5P599Ox2o+Ao4PBZi2/Rg9KUaAY3MBklGdi4We4n DVWo8um8DzbQhr0LBE8wS+im9F53 X-Google-Smtp-Source: ABdhPJxWo7b1+8z7C5sjreFY8mgZ4g1piopO5FqKxHUB3MTw06kE9AT9kS3PSwdL7MJQqe1+cBrmrA== X-Received: by 2002:a7b:c7cd:: with SMTP id z13mr25335204wmk.172.1636644186949; Thu, 11 Nov 2021 07:23:06 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:4092:: with SMTP id o18ls2187778wrp.1.gmail; Thu, 11 Nov 2021 07:23:06 -0800 (PST) X-Received: by 2002:a05:6000:184e:: with SMTP id c14mr9713661wri.241.1636644185925; Thu, 11 Nov 2021 07:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636644185; cv=none; d=google.com; s=arc-20160816; b=M7oYrFRG1YWiu29VQcFG6qyXZMXz58tPB1Yb0FQgldu8OTc2IRhrKLXKhg+EbPt+Vn YegWItwzlANuY5ocTasUwWimDtm5OG1sE/jXkDreSdWEUbkFPmPMPD4FFw1wJl1f9QgK EqzDeqoSudbJI5m6wpa6nfxyIwMQvYA6K20wbZ/Cf70mmqbJSA7aklHJYd7Y5OFrGSWY Pbzb5y/g/xLqwkuHUcWPf3QY6mgHjTuaKT2YJFapJzIL6W9IDI+ebc0cnFuvES9ooMIB pMr45Y6HBFG2iaGrVUj3OzPi6DTEsv6pts2pSiGMTp6hQ1tPyPg8NrXvJk77o4YvfSnf yvIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AkxPQ+zGtzjWUEvEDMFx6AuIxHT4FxOagW5HLsqAaLc=; b=RI+BCcUbpfKXX2lMfjUQzo75nlMOVZZfO58MSQIzkPM8rELW8cCSChFwXjdpQhLyHx AeiMIvzGUNaruzClt30AJmSxEPpi56fxm+rzCA9TPab4FbFHWIVXty7dwTNtM5kPeOf+ +pBH4i7DHw97OxC29XgNgoFqpkdu4Fdjlx67AY881YIr6hSyfbA7MVBkTfAtRmE4qOyE SHVb2n+tGILAdOURC/ospbJGmpgUYVZP/scOjZe83hG74slNJomDkQ6clVT0a+YhL8E7 y1oCvUVnK/nuVwnW7nN8NqD3Q+PxgdjUnZHu1nv9mqPDxPqhJOZDuTy+IvAIdDr9DWWG ymTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gans+dQh; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id o22sor2228705wra.45.2021.11.11.07.23.05 for (Google Transport Security); Thu, 11 Nov 2021 07:23:05 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr9781450wrt.31.1636644185490; Thu, 11 Nov 2021 07:23:05 -0800 (PST) Received: from panicking.pdxnet.pdxeng.ch ([5.171.215.77]) by smtp.gmail.com with ESMTPSA id f3sm8973683wmb.12.2021.11.11.07.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:23:04 -0800 (PST) From: Michael Trimarchi To: Ariel D'Alessandro Cc: linux-amarula@amarulasolutions.com, Anthony Brandon Subject: [PATCH 04/11] ASoC: fsl: add smm-s2-pro audio driver Date: Thu, 11 Nov 2021 16:22:51 +0100 Message-Id: <20211111152258.26131-4-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211111152258.26131-1-michael@amarulasolutions.com> References: <20211111152258.26131-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gans+dQh; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The smm-tlv320aic31xx driver implement audio support of smm-s2-pro BSH system master. Signed-off-by: Michael Trimarchi --- sound/soc/fsl/Kconfig | 11 ++ sound/soc/fsl/Makefile | 2 + sound/soc/fsl/smm-tlv320aic31xx.c | 308 ++++++++++++++++++++++++++++++ 3 files changed, 321 insertions(+) create mode 100644 sound/soc/fsl/smm-tlv320aic31xx.c diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 8e05d092790e..74430bc1e640 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -364,6 +364,17 @@ config SND_SOC_IMX_CARD with OF-graph DT bindings. It also support DPCM of single CPU multi Codec ststem. +config SND_SOC_SMM2_CARD + tristate "SoC Audio Card for SMM2 pro BSH device" + depends on OF && I2C + select SND_SOC_FSL_EASRC + select SND_SOC_TLV320AIC31XX + select SND_SOC_IMX_PCM_DMA + select SND_SOC_FSL_SAI + select SND_SIMPLE_CARD_UTILS + help + This option enables audio sound card support for BSH SMM2 Pro + endif # SND_IMX_SOC endmenu diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile index b54beb1a66fa..e85d7f6be709 100644 --- a/sound/soc/fsl/Makefile +++ b/sound/soc/fsl/Makefile @@ -72,6 +72,7 @@ snd-soc-imx-audmix-objs := imx-audmix.o snd-soc-imx-hdmi-objs := imx-hdmi.o snd-soc-imx-rpmsg-objs := imx-rpmsg.o snd-soc-imx-card-objs := imx-card.o +snd-soc-smm-tlv320aic31xx-objs := smm-tlv320aic31xx.o obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o obj-$(CONFIG_SND_SOC_IMX_ES8328) += snd-soc-imx-es8328.o @@ -81,3 +82,4 @@ obj-$(CONFIG_SND_SOC_IMX_AUDMIX) += snd-soc-imx-audmix.o obj-$(CONFIG_SND_SOC_IMX_HDMI) += snd-soc-imx-hdmi.o obj-$(CONFIG_SND_SOC_IMX_RPMSG) += snd-soc-imx-rpmsg.o obj-$(CONFIG_SND_SOC_IMX_CARD) += snd-soc-imx-card.o +obj-$(CONFIG_SND_SOC_SMM2_CARD) += snd-soc-smm-tlv320aic31xx.o diff --git a/sound/soc/fsl/smm-tlv320aic31xx.c b/sound/soc/fsl/smm-tlv320aic31xx.c new file mode 100644 index 000000000000..3aa71031d859 --- /dev/null +++ b/sound/soc/fsl/smm-tlv320aic31xx.c @@ -0,0 +1,308 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// BSH smm2-pro audio card +// +// Copyright (C) 2021 BSH Hausgeraete GmbH +// +// Author: Michael Trimarchi + +#include +#include +#include +#include +#include +#include +#include + +#include "fsl_sai.h" +#include "../codecs/tlv320aic31xx.h" + +/** + * struct smm_card_priv - Freescale Generic ASOC card private data + * @dai_link: DAI link structure including normal one and DPCM link + * @pdev: platform device pointer + * @card: ASoC card structure + * @sample_rate: Current sample rate + * @sample_format: Current sample format + * @asrc_rate: ASRC sample rate used by Back-Ends + * @asrc_format: ASRC sample format used by Back-Ends + * @dai_fmt: DAI format between CPU and CODEC + * @name: Card name + */ + +struct smm_card_priv { + struct snd_soc_dai_link dai_link[2]; + struct platform_device *pdev; + struct snd_soc_card card; + u32 sample_rate; + snd_pcm_format_t sample_format; + u32 asrc_rate; + snd_pcm_format_t asrc_format; + u32 dai_fmt; + char name[32]; +}; + +static const struct snd_soc_dapm_route audio_map[] = { + /* 1st half -- Normal DAPM routes */ + {"Playback", NULL, "CPU-Playback"}, + /* 2nd half -- ASRC DAPM routes */ + {"CPU-Playback", NULL, "ASRC-Playback"}, +}; + +/* Add all possible widgets into here without being redundant */ +static const struct snd_soc_dapm_widget smm_card_dapm_widgets[] = { + SND_SOC_DAPM_SPK("Ext Spk", NULL), +}; + +static int smm_card_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct smm_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); + struct device *dev = rtd->card->dev; + int ret; + + priv->sample_rate = params_rate(params); + priv->sample_format = params_format(params); + + ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_cpu(rtd, 0), 0x3, 0x3, 2, 32); + if (ret && ret != -ENOTSUPP) { + dev_err(dev, "failed to set TDM slot for cpu dai\n"); + goto fail; + } + + ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), AIC31XX_PLL_CLKIN_BCKL, + priv->sample_rate * 256, SND_SOC_CLOCK_IN); + if (ret && ret != -ENOTSUPP) { + dev_err(dev, "failed to set SYSCLK: %d\n", ret); + goto fail; + } + + return 0; + +fail: + return ret; +} + +static const struct snd_soc_ops smm_card_ops = { + .hw_params = smm_card_hw_params, +}; + +static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_hw_params *params) +{ + struct smm_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); + struct snd_interval *rate; + struct snd_mask *mask; + + rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); + rate->max = rate->min = priv->asrc_rate; + + mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); + snd_mask_none(mask); + snd_mask_set_format(mask, priv->asrc_format); + + return 0; +} + +SND_SOC_DAILINK_DEFS(hifi_fe, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_DUMMY()), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +SND_SOC_DAILINK_DEFS(hifi_be, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_DUMMY())); + +static struct snd_soc_dai_link smm_card_dai[] = { + /* DPCM Link between Front-End and Back-End */ + { + .name = "HiFi-ASRC-FE", + .stream_name = "HiFi-ASRC-FE", + .dpcm_playback = 1, + .dpcm_capture = 0, + .dynamic = 1, + SND_SOC_DAILINK_REG(hifi_fe), + }, + { + .name = "HiFi-ASRC-BE", + .stream_name = "HiFi-ASRC-BE", + .be_hw_params_fixup = be_hw_params_fixup, + .ops = &smm_card_ops, + .dpcm_playback = 1, + .dpcm_capture = 0, + .no_pcm = 1, + SND_SOC_DAILINK_REG(hifi_be), + }, +}; + +static int smm_card_probe(struct platform_device *pdev) +{ + struct device_node *cpu_np, *codec_np, *asrc_np; + struct device_node *np = pdev->dev.of_node; + struct platform_device *asrc_pdev = NULL; + struct platform_device *cpu_pdev; + struct smm_card_priv *priv; + struct device *codec_dev = NULL; + const char *codec_dai_name; + const char *codec_dev_name; + u32 width; + int ret; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + cpu_np = of_parse_phandle(np, "audio-cpu", 0); + if (!cpu_np) { + dev_err(&pdev->dev, "CPU phandle missing or invalid\n"); + ret = -EINVAL; + goto fail; + } + + cpu_pdev = of_find_device_by_node(cpu_np); + if (!cpu_pdev) { + dev_err(&pdev->dev, "failed to find CPU DAI device\n"); + ret = -EINVAL; + goto fail; + } + + codec_np = of_parse_phandle(np, "audio-codec", 0); + if (codec_np) { + struct platform_device *codec_pdev; + struct i2c_client *codec_i2c; + + codec_i2c = of_find_i2c_device_by_node(codec_np); + if (codec_i2c) { + codec_dev = &codec_i2c->dev; + codec_dev_name = codec_i2c->name; + } + if (!codec_dev) { + codec_pdev = of_find_device_by_node(codec_np); + if (codec_pdev) { + codec_dev = &codec_pdev->dev; + codec_dev_name = codec_pdev->name; + } + } + } + + asrc_np = of_parse_phandle(np, "audio-asrc", 0); + if (asrc_np) + asrc_pdev = of_find_device_by_node(asrc_np); + + if (!asrc_pdev) { + dev_err(&pdev->dev, "Unable to register the ASRC DAI device\n"); + ret = -EINVAL; + goto fail; + } + + /* Default sample rate and format, will be updated in hw_params() */ + priv->sample_rate = 48000; + priv->sample_format = SNDRV_PCM_FORMAT_S32_LE; + priv->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + + memcpy(priv->dai_link, smm_card_dai, + sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link)); + + codec_dai_name = "tlv320dac31xx-hifi"; + priv->card.dapm_routes = audio_map; + priv->card.num_dapm_routes = ARRAY_SIZE(audio_map); + + /* Initialize sound card */ + priv->pdev = pdev; + priv->card.dev = &pdev->dev; + priv->card.owner = THIS_MODULE; + ret = snd_soc_of_parse_card_name(&priv->card, "model"); + if (ret) { + snprintf(priv->name, sizeof(priv->name), "%s-audio", codec_dev_name); + priv->card.name = priv->name; + } + priv->card.dai_link = priv->dai_link; + priv->card.dapm_widgets = smm_card_dapm_widgets; + priv->card.num_dapm_widgets = ARRAY_SIZE(smm_card_dapm_widgets); + + if (of_property_read_bool(np, "audio-routing")) { + ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing"); + if (ret) { + dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret); + goto asrc_fail; + } + } + + /* DPCM DAI Links */ + priv->dai_link[0].cpus->of_node = asrc_np; + priv->dai_link[0].platforms->of_node = asrc_np; + priv->dai_link[1].codecs->dai_name = codec_dai_name; + priv->dai_link[1].codecs->of_node = codec_np; + priv->dai_link[1].cpus->of_node = cpu_np; + priv->dai_link[1].dai_fmt = priv->dai_fmt; + priv->card.num_links = 2; + + ret = of_property_read_u32(asrc_np, "fsl,asrc-rate", + &priv->asrc_rate); + if (ret) { + dev_err(&pdev->dev, "failed to get output rate\n"); + ret = -EINVAL; + goto asrc_fail; + } + + ret = of_property_read_u32(asrc_np, "fsl,asrc-format", + &priv->asrc_format); + if (ret) { + /* Fallback to old binding; translate to asrc_format */ + ret = of_property_read_u32(asrc_np, "fsl,asrc-width", + &width); + if (ret) { + dev_err(&pdev->dev, + "failed to decide output format\n"); + goto asrc_fail; + } + + if (width == 24) + priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE; + else + priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE; + } + + /* Finish card registering */ + platform_set_drvdata(pdev, priv); + snd_soc_card_set_drvdata(&priv->card, priv); + + ret = devm_snd_soc_register_card(&pdev->dev, &priv->card); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); + goto asrc_fail; + } + +asrc_fail: + of_node_put(asrc_np); + of_node_put(codec_np); + put_device(&cpu_pdev->dev); +fail: + of_node_put(cpu_np); + + return ret; +} + +static const struct of_device_id smm_card_dt_ids[] = { + { .compatible = "bsh,imx-audio-tlv320aic31xx", }, + {} +}; +MODULE_DEVICE_TABLE(of, smm_card_dt_ids); + +static struct platform_driver smm_bsh_card_driver = { + .probe = smm_card_probe, + .driver = { + .name = "smm-tlv320aic31xx", + .pm = &snd_soc_pm_ops, + .of_match_table = smm_card_dt_ids, + }, +}; +module_platform_driver(smm_bsh_card_driver); + +MODULE_DESCRIPTION("BSH smm2-pro audio card"); +MODULE_AUTHOR("Michael Trimarchi "); +MODULE_ALIAS("platform:smm-tlv320aic31xx"); +MODULE_LICENSE("GPL"); From patchwork Thu Nov 11 15:22:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1745 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BD3E13F07B for ; Thu, 11 Nov 2021 16:23:08 +0100 (CET) Received: by mail-wm1-f72.google.com with SMTP id b133-20020a1c808b000000b0032cdd691994sf4951500wmd.1 for ; Thu, 11 Nov 2021 07:23:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636644188; cv=pass; d=google.com; s=arc-20160816; b=gh7IMKfF7e/ofLXNipYZIJ0S9L9eqXPl/PbV0gNFJ4FtXVbVluTfbDeLfrxfQWjrVE xRWKLdsQoqm553viY4U3mI1B5aA2eDG2gr0WdJtTIoSP+XTNY4J0uV0znyEQBtba4jkZ xHhuM3Ah+JWGH+NElMNmx7g3T/r719ocIxfb6+z1hkr+/niC1x1AxwR6T+lXWdt+2Nfm rF/IyyeyL5qU7elPFbptNmucpUuECgwze4hcdB4bPikDdXTXQhh0ybkc7+wx+TzqF9l4 3hKQU/uDCxDeFzlGknveBLc+MEphftZaWIp1z+GovWp2RIiYzbOboryoIcTTzKDSl5Kp Dc6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=CdzT0YAF15B9ddcIOJ4P8KD1jy2WHt0l3i8u99M97QM=; b=yu6j8DphJ+r0rQ1lyqcAEFe5iBwV6Xb8JVI8e8CRKgJTV7a6UHQTcWzsBdLTh7NrFz fYifMhcNDeCIUmJfziz/vhN4ptvvBhgi5FBvju8sT43hNuUSpsllnbGe7Wm//GZFIM9d DbvM1QiK6XtMGi5YMPCryDB9Vd2GMehACzs2bXWznfvFgdxN9WnqHDE0B/2gut+zLJL6 Q67zOX6nQTyCr6tv+fFD+oVrnhIjThQcPLlu1CNn7I3OrUv0OYQ6XnPhbmPz5SiBEUYv k/JWIm84j+zLMxN+8dNBRY8OrNRnFHpWRhKGTVgMYclh7C/F4jndEj3D6VtdSLv9PrF5 ceHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SaVq9FK1; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=CdzT0YAF15B9ddcIOJ4P8KD1jy2WHt0l3i8u99M97QM=; b=qNydLdG08o5RHJwPOScUKtNZWk6se1QZPyBbZqPU0hArMTXQbQE33MmgvOWaH7ZLRZ LkVXIzR/CkB11GAwPIfrnOSGPqi4NnBu58DMSf201iDy4Fhggn7AickR2px7j7S9cA27 S3it9q1pQszgV2tsOge+HnXhFSc+15k8ziPvs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=CdzT0YAF15B9ddcIOJ4P8KD1jy2WHt0l3i8u99M97QM=; b=tnzjP9ES/KmFbDEwzfCjgECg02Qp6T7WmyyqSpH2yXmfATd4i1DWEwEvq+wjVf0FaH +sUKTaY+H+rb4qTtWVkgHxAa3LwgJYqqW8L4C7dZo5Yo98heuboz3YlEwPQ2n7emt01A QihJANikaqywdSucr8OqGvPaHDF2WnP1W5ge1ht4791JVzrC6h7ZKl6li3Ww3d+R3HPE CetqVMuzcgjM0cU1MLN/ygx+WV/3JrN/nYemglA8CltsYgtrW3bwH1949rkDi3TbcpfU yhvBP2opM2ouGdrqRARzL4yBIK8FvqKbhkhChSzhuDrZJvZJCkWIV6eyzgosK0m1nj3j kf/Q== X-Gm-Message-State: AOAM532fM7yZEpQ/nVnQ7DD2bDcnRCgrPoC4/3Q3STA4AEAFV5FDtQ7s 6q18EA7/keE7vLyWYe1FLMqjukHU X-Google-Smtp-Source: ABdhPJyGOIfDyJ3/UhG1Z6yz7upLBYOvZzCcrff0QTSsd8YQhuOZa8zK1GVlvziefMqoCffjtgYnQg== X-Received: by 2002:adf:ecca:: with SMTP id s10mr9673478wro.405.1636644188451; Thu, 11 Nov 2021 07:23:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a1c:23c8:: with SMTP id j191ls1708002wmj.1.gmail; Thu, 11 Nov 2021 07:23:07 -0800 (PST) X-Received: by 2002:a05:600c:4104:: with SMTP id j4mr8926254wmi.178.1636644187370; Thu, 11 Nov 2021 07:23:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636644187; cv=none; d=google.com; s=arc-20160816; b=oxu99NyzdkRcOfqTTFz+f4/qtHgBx2G96mPqwn724AokoSnMS6xd9zeEIKesZmhYxG t2V6E1LteHmtc0NjbK+4fcXRdVCs3XFf3+GMWixvIz7KBc/mFDka447yudT9CRzQbzNr 7Yz05fKMR8XuBL1wyaRhO+0MhYRNBGJgXhA0fji+zcIyOPkg2ujD+gApmB78FqBw7JLF qHszD5xD4wIfpsHMIihPs8ntKzOHKGuQx/AykPqUsQs25dQploIMzfoCJ6xjb0t8GeXT 9rovkyksR5GQxfUVco6NgzlZttmGdJhpxmcmz+r7RzXEa0d9ds3TjHlUqCEpCLI8obVY bPEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=/57MPDT/LnfMVYe/0IMID8HF9EYxmuZOmPC6vNxqAbs=; b=dR3F/jSV1PaO22iTyrq9gGLVadxpAuDV+jtVTVvGpXmLdpLQ9YpWQ/tT+KZuEa8C5f 8ZCr1yVyN3QN+YO1YoRtccY2ZtW4YEK0rczRcPNPggkC8dS4ZLR0TMAcF94VFgqvvZ2f Pj2ldGmk5feyYUZpeAp/w5eBroHYCGZN7d9UoBcuycwEMsoZmQls3+4jTBH3JKT5zJ4O Iik4AD72BExUrZ8RNi0D4fbuTsgm61JBSBuBbc8KPzvxv5otpCeSzISle0yxzZpTnVT4 jBdglmpgCLq39V29yAKwMk58Typ6X6An/kj+2gbH8n/wKVxMfDKFVgFeQlIp0olbaYu3 r0Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SaVq9FK1; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id m32sor6282665wms.14.2021.11.11.07.23.07 for (Google Transport Security); Thu, 11 Nov 2021 07:23:07 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a1c:f002:: with SMTP id a2mr26058557wmb.79.1636644186985; Thu, 11 Nov 2021 07:23:06 -0800 (PST) Received: from panicking.pdxnet.pdxeng.ch ([5.171.215.77]) by smtp.gmail.com with ESMTPSA id f3sm8973683wmb.12.2021.11.11.07.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:23:06 -0800 (PST) From: Michael Trimarchi To: Ariel D'Alessandro Cc: linux-amarula@amarulasolutions.com, Anthony Brandon Subject: [PATCH 05/11] arm64: dts: imx8mn-bsh-smm2-pro: Register sound-tlv320aic31xx audio card Date: Thu, 11 Nov 2021 16:22:52 +0100 Message-Id: <20211111152258.26131-5-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211111152258.26131-1-michael@amarulasolutions.com> References: <20211111152258.26131-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SaVq9FK1; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add the registration of audio card based on tlv320aic31xx family codec. The audio card expose two playback device. One of them use the easrc that let you use all the frequency. In order to properly works the sdma and easrc firmware must be loaded and installed in the filesystem. The card can support only S32_LE and 48Khz and this is configured in easrc node Signed-off-by: Michael Trimarchi --- .../freescale/imx8mn-bsh-smm-s2-common.dtsi | 6 +- .../dts/freescale/imx8mn-bsh-smm-s2pro.dts | 93 +++++++++++++++++++ 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2-common.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2-common.dtsi index 108a29d4e7ae..038a7368be86 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2-common.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2-common.dtsi @@ -128,7 +128,7 @@ buck3_reg: BUCK3 { buck4_reg: BUCK4 { /* PMIC_BUCK6 - VDD_3V3 */ regulator-name = "buck4"; - regulator-min-microvolt = <3000000>; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; @@ -137,8 +137,8 @@ buck4_reg: BUCK4 { buck5_reg: BUCK5 { /* PMIC_BUCK7 - VDD_1V8 */ regulator-name = "buck5"; - regulator-min-microvolt = <1605000>; - regulator-max-microvolt = <1995000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; regulator-boot-on; regulator-always-on; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2pro.dts b/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2pro.dts index c6a8ed6745c1..0328e48e3f92 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2pro.dts +++ b/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2pro.dts @@ -7,6 +7,7 @@ /dts-v1/; #include "imx8mn-bsh-smm-s2-common.dtsi" +#include / { model = "BSH SMM S2 PRO"; @@ -16,6 +17,68 @@ memory@40000000 { device_type = "memory"; reg = <0x0 0x40000000 0x0 0x20000000>; }; + + sound-tlv320aic31xx { + compatible = "bsh,imx-audio-tlv320aic31xx"; + model = "tlv320aic31xx-hifi"; + audio-cpu = <&sai3>; + audio-codec = <&codec>; + audio-asrc = <&easrc>; + audio-routing = + "Ext Spk", "SPL", + "Ext Spk", "SPR"; + }; + + vdd_input: vdd_input { + compatible = "regulator-fixed"; + regulator-name = "vdd_input"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; +}; + +&easrc { + fsl,asrc-rate = <48000>; + fsl,asrc-format = <10>; + status = "okay"; +}; + +&i2c2 { + clock-frequency = <400000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + status = "okay"; + + codec: tlv320dac3101@18 { + #sound-dai-cells = <0>; + compatible = "ti,tlv320dac3101"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_dac_rst>; + reg = <0x18>; + + ai31xx-micbias-vg = ; + + HPVDD-supply = <&buck4_reg>; + SPRVDD-supply = <&vdd_input>; + SPLVDD-supply = <&vdd_input>; + AVDD-supply = <&buck4_reg>; + IOVDD-supply = <&buck4_reg>; + DVDD-supply = <&buck5_reg>; + reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + + clocks = <&clk IMX8MN_CLK_SAI3_ROOT>; + clock-names = "mclk"; + }; +}; + +&sai3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai3>; + assigned-clocks = <&clk IMX8MN_CLK_SAI3>; + assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>; + assigned-clock-rates = <24576000>; + fsl,sai-mclk-direction-output; + status = "okay"; }; /* eMMC */ @@ -30,6 +93,36 @@ &usdhc1 { }; &iomuxc { + pinctrl_dac_rst: dac_rst { + fsl,pins = < + MX8MN_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x19 /* DAC_RST */ + >; + }; + + pinctrl_espi2: espi2grp { + fsl,pins = < + MX8MN_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x082 + MX8MN_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x082 + MX8MN_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x082 + MX8MN_IOMUXC_ECSPI2_SS0_ECSPI2_SS0 0x040 + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX8MN_IOMUXC_I2C2_SCL_I2C2_SCL 0x400000c3 + MX8MN_IOMUXC_I2C2_SDA_I2C2_SDA 0x400000c3 + >; + }; + + pinctrl_sai3: sai3grp { + fsl,pins = < + MX8MN_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6 + MX8MN_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6 + MX8MN_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6 + >; + }; + pinctrl_usdhc1: usdhc1grp { fsl,pins = < MX8MN_IOMUXC_SD1_CLK_USDHC1_CLK 0x40000090 From patchwork Thu Nov 11 15:22:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1746 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 72A193F07B for ; Thu, 11 Nov 2021 16:23:10 +0100 (CET) Received: by mail-wm1-f69.google.com with SMTP id l6-20020a05600c4f0600b0033321934a39sf2834826wmq.9 for ; Thu, 11 Nov 2021 07:23:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636644190; cv=pass; d=google.com; s=arc-20160816; b=Iyocn67eCAh04pFjgp+yt0SnIraK9dGdnwTXcVy8lEmtOTLgxUK++5BNxguzThQYqr /1gT97xZPXLv0WqyQ808g+tpke/S24ituFS4/LK7jTX2b3GQgkLvSLKCBJpFn3bGUgv/ 3DCZe+ldUsJyBytGy4L65lOSS6r1w/Re44p++rpZuS1PuxvAk+wsm/Kvb6ZRnJ1wLkbi rfcMQQ0LZUyqcwVg72HaC7E4zfuMsHAIZNiI7j/3G8PufZPTtwkTP93CQ5NYMIEKIAFH 08AZxkJOct/Ywi3pmhtnxXNUrVlL3PmNK8ZJdTWvK7aN6lbZhRlS4PLv3MxVdR1Zw6lx 0dkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=XnJ56nyr+2yTx+X5T9+0mm57uiqTbkl7TAJmfSyBigs=; b=nyV6I4diClzRFCXgqWxWl17MsCqbbHf1APpnJEVEkUeb0c8aVlr5c8t2jr36vv0KUS z3FKT/S4rs1pOntXnZWsr2QwHN6qxfzOf1kkOJjSJ7fTPsO4VRJ0kMZo6sPrMW9uytSC JVf+SdB+/AHYrQwo3MI0RrKDcPguFe/vOAnYxDvJorDVmSK4e0M7/T8avLBvwnWQCpvR sPH+C/FXXuI/QBbdZWpjtDDN2pkpvr7prJmx4wSlS7Sti9Ad5zy7nsFnMDptujBzIVnG R3Udpcr996kUf6yfthCTDo/Mm+jot01d/ClFEnUcAVXraPjB4bidt4VtZW2L3UBb2IqR sNTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SEiqDmSK; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=XnJ56nyr+2yTx+X5T9+0mm57uiqTbkl7TAJmfSyBigs=; b=avPv6FKF3kkXViaWUjP2vmHknc2gzDptI6q5W+vPo9t1coYDgtUSXO1NOBLAaAUDEH nSk/bvvANj7cnSt8yEkhanPxtpN99vH11sZqN3MT7K0yYGGV1jWEBVzU7rBDmllpjFE0 /L3OoRkVrdLl2p/1uCwLBBSBQqE55IClG3c68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=XnJ56nyr+2yTx+X5T9+0mm57uiqTbkl7TAJmfSyBigs=; b=Z2Hfokt9YzipG0PaCJQRlJsCt8KG3gSqlwHadHOgeKg8wrp3Op79x8+IDZneDnP88m +BxIO+QedSHRtQ9XgZFLTE/n2smxuRIE3h82y/FQNy6OyMcroGySgLMN/8IjOxHDGI27 Cl6DNnpzb/xB0CohqNY3swx5Wxtif1dBYd+j29H9ae893A2HNypAMTzP/GevwOLbazyB r+E8wXgUepTzDgGIAoEwwfCmkBWlja8z0YPo0zOTxN3L9t4B9jRvdP4E9TC1V9JZS0Rl xdDrhVr+4CihWWDxQYekihJF/JqwztJYDYM2eTsq9oHPk6ddj957YEu+lTgzgzLQpoAE 6f7Q== X-Gm-Message-State: AOAM533QFzIEyVel5h2agitcMHOmjAGAgTq/C3GCYJ03E4bSUH3wwFLn MCSo02xztgm4F3K2AnUBR/M4Xs7p X-Google-Smtp-Source: ABdhPJwRuIVmG0XjnTnvq2KB5wmiyqSMP+ie0ms+NRTuT8qJ72+XfXCwxSAB+1eyWH3asCD2vksG6Q== X-Received: by 2002:adf:d1e2:: with SMTP id g2mr7560325wrd.362.1636644190234; Thu, 11 Nov 2021 07:23:10 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:ad6:: with SMTP id c22ls5124357wmr.1.canary-gmail; Thu, 11 Nov 2021 07:23:09 -0800 (PST) X-Received: by 2002:a05:600c:22cb:: with SMTP id 11mr9000301wmg.181.1636644189162; Thu, 11 Nov 2021 07:23:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636644189; cv=none; d=google.com; s=arc-20160816; b=mwsYy6ubtvPTb55UTtu0ADXd26Pn+hKhFG2Y9EVc51fiOrfFhJjmDSAMdsoPiSDglH MsalfHUhOlmZ7hXE4/YtiOQf12tpt42Qk2i3+FZGSlc9GTQ4GF4JM6zv0ajZlAz3bxnD Se4ebzRi8df156ZWe3vw0XC6Hdg1WTQjS4S22qDRec3MJUEQZcLUu670TUSimZKS/P8E 74t3iCzlYV+kIGDE/T9U6ww3+QvaWWO7S6oZbGVwhroXQ+4+GpnA0bs+Yq7N/KRjvC3n fdaIVaX/ZG3ntDX8NqifUySCNBipf7sbmDmJH+CwZDBneGuPlPwXL4GD9aIPbRTmcqOV iT2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=1LE+XNBolkTsWIvH8Ut6LTTHH4UL3wj1a74HRrrRWGs=; b=YUZjjJXwsrnQ8N6wlbcPcUpqTfPpXGrror28Tjthz7Y7jhu34Cx5elLII4Df4OlJQ2 c56Ezd2i05OwiRpLz1oNMK91p4lmaOBnatOcuVBBn4Kj1D0YP9E0RsjrtaW4aq4jP3cM +W1IRPMF7OXttdJRT3L2lo2uFyHgNZCSIa5ui4j7NY9O0zBIF5c6PZaxhFJwjkG52ZQu SSWVIa6kGdnJ+ClP2I2bCHGECIsbJfTyrr9mLRAq9XIDYZPCu85Aqg6MddMqg9hbilWT Fr+yRBv+P68QptpCo98AVCRe4rJ/OFBh2yY3QFsjDFTMn6rMbE8AeLJOezpvNOTbaf24 Of4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SEiqDmSK; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id c4sor2322021wrb.6.2021.11.11.07.23.09 for (Google Transport Security); Thu, 11 Nov 2021 07:23:09 -0800 (PST) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a5d:6ac7:: with SMTP id u7mr9547761wrw.57.1636644188792; Thu, 11 Nov 2021 07:23:08 -0800 (PST) Received: from panicking.pdxnet.pdxeng.ch ([5.171.215.77]) by smtp.gmail.com with ESMTPSA id f3sm8973683wmb.12.2021.11.11.07.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:23:08 -0800 (PST) From: Michael Trimarchi To: Ariel D'Alessandro Cc: linux-amarula@amarulasolutions.com, Anthony Brandon Subject: [PATCH 06/11] drm/panel: Add Synaptics R63353 panel driver Date: Thu, 11 Nov 2021 16:22:53 +0100 Message-Id: <20211111152258.26131-6-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211111152258.26131-1-michael@amarulasolutions.com> References: <20211111152258.26131-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SEiqDmSK; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The LS068B3SX02 panel is based on the Synaptics R63353 Controller. Add a driver for it. Signed-off-by: Michael Trimarchi --- drivers/gpu/drm/panel/Kconfig | 8 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-synaptics-r63353.c | 362 ++++++++++++++++++ 3 files changed, 371 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-synaptics-r63353.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 2cb8eba76af8..ee135b178235 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -551,6 +551,14 @@ config DRM_PANEL_SITRONIX_ST7789V Say Y here if you want to enable support for the Sitronix ST7789V controller for 240x320 LCD panels +config DRM_PANEL_SYNAPTICS_R63353 + tristate "Synaptics R63353-based panels" + depends on OF + depends on DRM_MIPI_DSI + help + Say Y if you want to enable support for panels based on the + Synaptics R63353 controller. + config DRM_PANEL_SONY_ACX424AKP tristate "Sony ACX424AKP DSI command mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 6e30640b9099..9e80106f69dc 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -56,6 +56,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o +obj-$(CONFIG_DRM_PANEL_SYNAPTICS_R63353) += panel-synaptics-r63353.o obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o obj-$(CONFIG_DRM_PANEL_TDO_TL070WSH30) += panel-tdo-tl070wsh30.o diff --git a/drivers/gpu/drm/panel/panel-synaptics-r63353.c b/drivers/gpu/drm/panel/panel-synaptics-r63353.c new file mode 100644 index 000000000000..da3886c8a4dc --- /dev/null +++ b/drivers/gpu/drm/panel/panel-synaptics-r63353.c @@ -0,0 +1,362 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Synaptics R63353 Controller driver + * + * Copyright (C) 2020 BSH Hausgerate GmbH + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include