From patchwork Thu Apr 4 11:17:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 161783 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1466222jan; Thu, 4 Apr 2019 04:18:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyD9hXQ7dw7zFFRRgU4seN6jHK0/qp8U+3rBlIGLngRN3Vvqmp+cQvjVxyYQ/b9UZl9fUtN X-Received: by 2002:a63:d352:: with SMTP id u18mr5308465pgi.315.1554376699631; Thu, 04 Apr 2019 04:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554376699; cv=none; d=google.com; s=arc-20160816; b=hY9Mb01GbnWq+ahFK+/6vau2lJCQ8nq7AiRNaKukEPKa1/7rlSdY4BwUCqdc+sHuNV wo+2hl4OGXy3JsyC8MQD7rehDK62WHHdv88kdmgGyGczpYT4tOqLx2T65GeRDVB5wdRy pu1iQsCL76CfHx72ohVX03p0E0hVxoUul5ajX3r39DgstMB1fGzaHPYgw6VfOi88DEOq 2n7N3DtCZuAh9schDFcUePBzYk02CEwxB5ALMMndwtolGXyusFJu3wn0D5IuWE9D/KCN 7v99l1OzZXw1SGcTueGphYMlWjP3AT7IjmTfLbUyNn4loTARWuIoaG8SgkXXOA1IGza2 hqtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=THvGG4Utk/yOwuQrm+R95dAZZj74janifYZa4/M9XJQ=; b=HqMj7pOiW6FzdRsIlDeHjSkSyJd+KmPfGCns51pyIyLNZlgihIK7fkwd8PeDWD2y2U Cuas8IUIYYjoP1J5JSIOrDZ/CwMTgxXO6zEtLuz4G/HNoQ5A5UMkPlSl9DSpdK+4iPAC YGlbc6EOVKaxJathRQVk8E45ni4lRqImUrE4Qf9bg28bSXKT9oTyMHrh/tDaRhoBi932 yuTMpPQ808Qvw6PQmyEfj19S3tkhpcaf3vtukDr1yrBeDghZ0I44thRzUnLI+EbKG9Aj Fjz5phRIR+9MNzEq6w7iUdwKGhsWybEC1PzGGQM/w7Gi34A0Azav8atEdohldXX8Q26D iotA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=IlCQxrhQ; 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 l17si15719069pff.202.2019.04.04.04.18.19; Thu, 04 Apr 2019 04:18:19 -0700 (PDT) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=IlCQxrhQ; 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 S1729588AbfDDLRv (ORCPT + 31 others); Thu, 4 Apr 2019 07:17:51 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34277 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729292AbfDDLRs (ORCPT ); Thu, 4 Apr 2019 07:17:48 -0400 Received: by mail-wr1-f68.google.com with SMTP id p10so3308923wrq.1 for ; Thu, 04 Apr 2019 04:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=THvGG4Utk/yOwuQrm+R95dAZZj74janifYZa4/M9XJQ=; b=IlCQxrhQiFzp0pFJ/mN+j38HrpoPXfY9hI+kbZNIqGDS2UyzPLqUWKXh5o7IkWcFrH M/oHchaABXJb/6sak+Bes+NL1fXHsI8dDFNnkg6sjI/jU2zAPqYMY83d1/CsFeGql1V8 lvEr9Pq8gvjhtcoJ8rtBMs5ANcsGrOfK59jmEDUPIS9QNtoqaJAMLN+bu44DVISE3qfp fKspSnM4K/JN9cbRlfP9S+hD3ARAgNA7aiHgcSRcy8zlA8KpOm6pxVximGe5kAdjL5NG ZOULw+rKsRbcJXtq2t6jdczacGpAZEHCYMhUf3kZnzCw59UeL+xZ9OWaZNDZdPzPW6e5 dy0Q== 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=THvGG4Utk/yOwuQrm+R95dAZZj74janifYZa4/M9XJQ=; b=E7ZigIkGDtgYvsIuHJ/5bwsSbnKPTNwTvFJpXuDb4k93ncI19CMEwUlRN88PAyvhMq cTg+vqRiAQbN1xvvTCSSAlIu26WnOM66yak1cV+eW/wboo6Zy4CrL/BjKe7wME271N6G +OEemyIw/5oUt9kPscwXcK4EOw0cY6yjS6T4qFRtOKIaE/YyTqjIZpHezsXlS6RLi+ev rpxKLu3LLN2OmkSkr87IxxHKbA3fJ8QwUzyQinu80mqlcVhuxE0JWT3UyrIIYWIkfWir NsQfWyvfeupP4A+gmNZkunTXlnxbiJ+kHwPPTA9btF8zE6kj0jlez9rW/kOEUTezks6F MOVg== X-Gm-Message-State: APjAAAWY/ygLdW/SWlt6H7O46ZYQC4iepYwEVXDJ12rJ9zvS0assVRwd U2FTuNITvwu8HcJwiqzI0qsD1g== X-Received: by 2002:adf:e602:: with SMTP id p2mr3474242wrm.105.1554376666071; Thu, 04 Apr 2019 04:17:46 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id z23sm9024771wma.0.2019.04.04.04.17.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 04:17:45 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , Kevin Hilman , Maxime Jourdan , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 1/6] ASoC: meson: add g12a compatibles Date: Thu, 4 Apr 2019 13:17:28 +0200 Message-Id: <20190404111733.28705-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190404111733.28705-1-jbrunet@baylibre.com> References: <20190404111733.28705-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add new compatible strings for the g12a devices. Audio wise, the g12a is fairly to close to the axg, yet some differences need to be handled. Signed-off-by: Jerome Brunet --- Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt | 4 +++- Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt | 3 ++- .../devicetree/bindings/sound/amlogic,axg-spdifin.txt | 3 ++- .../devicetree/bindings/sound/amlogic,axg-spdifout.txt | 3 ++- .../devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt index 3dfc2515e5c6..4330fc9dca6d 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt @@ -2,7 +2,9 @@ Required properties: - compatible: 'amlogic,axg-toddr' or - 'amlogic,axg-frddr' + 'amlogic,axg-toddr' or + 'amlogic,g12a-frddr' or + 'amlogic,g12a-toddr' - reg: physical base address of the controller and length of memory mapped region. - interrupts: interrupt specifier for the fifo. diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt index 5672d0bc5b16..73f473a9365f 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt @@ -1,7 +1,8 @@ * Amlogic Audio PDM input Required properties: -- compatible: 'amlogic,axg-pdm' +- compatible: 'amlogic,axg-pdm' or + 'amlogic,g12a-pdm' - reg: physical base address of the controller and length of memory mapped region. - clocks: list of clock phandle, one for each entry clock-names. diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt index 2e6cb7d9b202..0b82504fa419 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt @@ -1,7 +1,8 @@ * Amlogic Audio SPDIF Input Required properties: -- compatible: 'amlogic,axg-spdifin' +- compatible: 'amlogic,axg-spdifin' or + 'amlogic,g12a-spdifin' - interrupts: interrupt specifier for the spdif input. - clocks: list of clock phandle, one for each entry clock-names. - clock-names: should contain the following: diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt index 521c38ad89e7..826152730508 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt @@ -1,7 +1,8 @@ * Amlogic Audio SPDIF Output Required properties: -- compatible: 'amlogic,axg-spdifout' +- compatible: 'amlogic,axg-spdifout' or + 'amlogic,g12a-spdifout' - clocks: list of clock phandle, one for each entry clock-names. - clock-names: should contain the following: * "pclk" : peripheral clock. diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt index 1c1b7490554e..3b94a715a0b9 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt @@ -2,7 +2,9 @@ Required properties: - compatible: 'amlogic,axg-tdmin' or - 'amlogic,axg-tdmout' + 'amlogic,axg-tdmout' or + 'amlogic,g12a-tdmin' or + 'amlogic,g12a-tdmout' - reg: physical base address of the controller and length of memory mapped region. - clocks: list of clock phandle, one for each entry clock-names. From patchwork Thu Apr 4 11:17:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 161779 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1465823jan; Thu, 4 Apr 2019 04:17:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2mmrbdiYhgmFDfCxKJOEWOZXSUeKIp0pr9wEWKtKi8WC16rfkbw3I9YT6SLzCMCNyMHh2 X-Received: by 2002:a17:902:3e3:: with SMTP id d90mr5748827pld.271.1554376674953; Thu, 04 Apr 2019 04:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554376674; cv=none; d=google.com; s=arc-20160816; b=AHQg/UzAfqdZyJRrwGob+Pr9eCcNXJZsJjGBXLdaLUGUHoWjdc+pBS/oHraSN0V7y9 GkLKulfoy+DGG2RP6s+Un6mcuAzYxT3XRGooaewGc3OF8upSKcbtumzx46whcgRKuwPj ofuwsDVsVZB6n2p0ZLpdbcQ5fliftg+tIfBlrMMwVvVfgoWz2Z4akQfAqaYUIvb87/QC 3xAOjEhfM70XRkBCCEPk8zWmq20L+mhWqiSW0m3fhKZ9rY7kd2nC8CNTKzpvW6UHf+5Y bPscu57gJg/iDIsxXRXtMk7psEVOqcDBtwxB2nnmQMtJv7BoG1tOGwsJhfX/mK7+br2G n4RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a6/aPiwJImd9Yf/1x3AIYjuPQVGbfZJWmEdQdmDDJF0=; b=zUtIDPj0p8yjqZ6qcwWDzlnWFu+c+BQUlfCfgdzu0dpeZP1LRaqMiUSxjvBCjE87IR bPSSFWb9+Lqy2vAJHMA2lHGB2FOVbJUL8toZvN+5q6e0Fx0Opvh+o9sXy8tLaThVSWmM aQu9oqWtzynogsN08/qh/eyzwicvJTBSJQptXdDBj/0GLsQEERc8dEn/gH6iTQEd9hrh 18BoE9faFqSvU/MltvJgoFBmrBuzSe+b00HjET671rnzzaurfWDFkZRDQNSC/KRGgaqp DGGQMqxLtB3yOFLWbvbkZE1q0oX+U5amJP+LpYFRsDZhcS0Tu98Unn5ec7FW+n3QhLLw ggdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VRqVwD9n; 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 o77si5589409pfi.247.2019.04.04.04.17.54; Thu, 04 Apr 2019 04:17:54 -0700 (PDT) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VRqVwD9n; 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 S1729627AbfDDLRx (ORCPT + 31 others); Thu, 4 Apr 2019 07:17:53 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42249 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729538AbfDDLRv (ORCPT ); Thu, 4 Apr 2019 07:17:51 -0400 Received: by mail-wr1-f68.google.com with SMTP id g3so3247047wrx.9 for ; Thu, 04 Apr 2019 04:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a6/aPiwJImd9Yf/1x3AIYjuPQVGbfZJWmEdQdmDDJF0=; b=VRqVwD9nClMKS7AuQzKp0WArnEbQFPjoNZHdzPHpfZZFO3L5+kIU6oPiGjOJr0lKeb vxncXZ34Mh2qYMBw9qnh1seFFNZh5zdfJFbG6jtiY0BTRAYqB7EbNNdp/+dgiiF7ABZt 3bJXYGNOZ7d8wELHUF0zkGbqbe4eLl9v8IvdUl+wNVnEDxvzXFmXFy+MWVWJ2sbB4XBq p/qv/uowgNqb7SdhODjUgEH3YKhZOKIztwG7aj3y3cnUMX31ZbUgzTCl3v9716OE3Vih kcq+ZoXh1o6ODfwBwygNiiJA93GYOoroln1K0BQuFvr28UTdCN0/03P+M/lTThByjkfd wV7Q== 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=a6/aPiwJImd9Yf/1x3AIYjuPQVGbfZJWmEdQdmDDJF0=; b=F8Zt50t6f4j0Qfep94Or+jUy0uVftGjWsZ97BixfNgFF8bMlLg0b/vVwK5H5Wq4dzx rN1wU7t5q5UviJjrS0kkiFKRNI3bzYwq425BRMB0uwsd1uI2bV95wYXngk7/NipFt4ve dVyPD1S/DkWQMP4GGYWmATqy+o5BNIV9SX2zF5CKVy6mGn2c1pT7ghSpQxfBPFPanF2l 249yCSm8FekbooiTJWlhPC1MUSNJuW9dkDjfM53PJOrg0vm1sYlN/htHhWDHS8oGVtLT 8I5/aEx62dBQui8of9l0hZyEeoEWJoHM7M4TgUHXV9JiZRR0uR5bvn/XfqZmPbGOUE2G M7gg== X-Gm-Message-State: APjAAAUWC0TPSgLsK8xZUS8tK3SsK6sH2/hg+XuiRr2q5xxD1UACxaAE TZKphY9rjSGHTDkWynFAuvNGTA== X-Received: by 2002:a5d:684e:: with SMTP id o14mr3974350wrw.138.1554376669312; Thu, 04 Apr 2019 04:17:49 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id z23sm9024771wma.0.2019.04.04.04.17.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 04:17:48 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , Kevin Hilman , Maxime Jourdan , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 3/6] ASoC: meson: axg-toddr: add g12a support Date: Thu, 4 Apr 2019 13:17:30 +0200 Message-Id: <20190404111733.28705-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190404111733.28705-1-jbrunet@baylibre.com> References: <20190404111733.28705-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the g12a SoC fifo can set the fifo initial start address, we must make sure to actually reset the write pointer to this address when starting a capture. Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-toddr.c | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) -- 2.20.1 diff --git a/sound/soc/meson/axg-toddr.c b/sound/soc/meson/axg-toddr.c index 0e9ca3882ae5..4f63e434fad4 100644 --- a/sound/soc/meson/axg-toddr.c +++ b/sound/soc/meson/axg-toddr.c @@ -24,6 +24,7 @@ #define CTRL0_TODDR_MSB_POS(x) ((x) << 8) #define CTRL0_TODDR_LSB_POS_MASK GENMASK(7, 3) #define CTRL0_TODDR_LSB_POS(x) ((x) << 3) +#define CTRL1_TODDR_FORCE_FINISH BIT(25) #define TODDR_MSB_POS 31 @@ -33,6 +34,22 @@ static int axg_toddr_pcm_new(struct snd_soc_pcm_runtime *rtd, return axg_fifo_pcm_new(rtd, SNDRV_PCM_STREAM_CAPTURE); } +static int g12a_toddr_dai_prepare(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct axg_fifo *fifo = snd_soc_dai_get_drvdata(dai); + + /* Reset the write pointer to the FIFO_INIT_ADDR */ + regmap_update_bits(fifo->map, FIFO_CTRL1, + CTRL1_TODDR_FORCE_FINISH, 0); + regmap_update_bits(fifo->map, FIFO_CTRL1, + CTRL1_TODDR_FORCE_FINISH, CTRL1_TODDR_FORCE_FINISH); + regmap_update_bits(fifo->map, FIFO_CTRL1, + CTRL1_TODDR_FORCE_FINISH, 0); + + return 0; +} + static int axg_toddr_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -172,10 +189,46 @@ static const struct axg_fifo_match_data axg_toddr_match_data = { .dai_drv = &axg_toddr_dai_drv }; +static const struct snd_soc_dai_ops g12a_toddr_ops = { + .prepare = g12a_toddr_dai_prepare, + .hw_params = axg_toddr_dai_hw_params, + .startup = axg_toddr_dai_startup, + .shutdown = axg_toddr_dai_shutdown, +}; + +static struct snd_soc_dai_driver g12a_toddr_dai_drv = { + .name = "TODDR", + .capture = { + .stream_name = "Capture", + .channels_min = 1, + .channels_max = AXG_FIFO_CH_MAX, + .rates = AXG_FIFO_RATES, + .formats = AXG_FIFO_FORMATS, + }, + .ops = &g12a_toddr_ops, + .pcm_new = axg_toddr_pcm_new, +}; + +static const struct snd_soc_component_driver g12a_toddr_component_drv = { + .dapm_widgets = axg_toddr_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(axg_toddr_dapm_widgets), + .dapm_routes = axg_toddr_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(axg_toddr_dapm_routes), + .ops = &g12a_fifo_pcm_ops +}; + +static const struct axg_fifo_match_data g12a_toddr_match_data = { + .component_drv = &g12a_toddr_component_drv, + .dai_drv = &g12a_toddr_dai_drv +}; + static const struct of_device_id axg_toddr_of_match[] = { { .compatible = "amlogic,axg-toddr", .data = &axg_toddr_match_data, + }, { + .compatible = "amlogic,g12a-toddr", + .data = &g12a_toddr_match_data, }, {} }; MODULE_DEVICE_TABLE(of, axg_toddr_of_match); From patchwork Thu Apr 4 11:17:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 161780 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1465888jan; Thu, 4 Apr 2019 04:17:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRlSKUs7aSeJNR4NiAk+lvER9gm09oAnITIEYAJMG0dIe3NsXRjESJbiXYnUXxuxxZLguL X-Received: by 2002:a62:ed08:: with SMTP id u8mr5173301pfh.200.1554376678855; Thu, 04 Apr 2019 04:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554376678; cv=none; d=google.com; s=arc-20160816; b=E3Q2WQxZaOBeU5jq80QWtXz+b/kOmyEX5PwHx1QJqIeRNdDr5/yTXs19fNuyvjV1Kp sdgteA50zaScqTC8I3j5PyVqQrhlrc1eYKa6I52P3Fbl1uvdu48Jwb6rzBnlWQbZHfIs VdtTQk4rm07FJOQ4ADO8Mu6+D6BuJ4yL8NYzDgbMIxnKXVpokC999reHhvGeyhvnrhWp QmKrG03R/iwmiAqwlzbjhHAXJTQG1zSEKwSEfA3nxcMI9qveMB3Iw2d95igULVB8dhPs v27/6leP++ML1qX0ASdW114+bUSiZNGPpIEc+3NPU4JdPvb8rb9CIIsiQCGviEXUPWl/ JHEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3bu8sSj/St5z5A/eP0AMpKjvggaQ9cr9OipT1kkMzPs=; b=IVjU4k5mwQQuAR6tv0awEmZwoW5Z2eBgZwJ2PLplW9e7Eza6K/GFo86Qm5UjIqii1a S7gSN1hdkKfS7dUfRyXJCe30imCTwZairLLhQfA6XBhYn17qx0c4D9JVrSJIq6Kq0uSY tq18hGHxoLbwkYgejX9dGAj1QGNdxugwL2SIFvtykTWiViBqL2xLDbTChIXoyu4HWh/F E4jZsSHysTBfrkGbJM09qgq0rqSNF3WBIOYSiukJ2ZYJ4mEhj58OCRKxZ54P2VbN2EMd jjablV2zkU/K9Cpo6r4gNTWwS9smKUXeqhcXx5Ekidr+xQ+4pPLPYi+RSZ9u8nMpPsbU XkrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=FKy5BGl6; 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 o77si5589409pfi.247.2019.04.04.04.17.58; Thu, 04 Apr 2019 04:17:58 -0700 (PDT) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=FKy5BGl6; 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 S1729699AbfDDLR4 (ORCPT + 31 others); Thu, 4 Apr 2019 07:17:56 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37716 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729563AbfDDLRx (ORCPT ); Thu, 4 Apr 2019 07:17:53 -0400 Received: by mail-wr1-f68.google.com with SMTP id w10so3290052wrm.4 for ; Thu, 04 Apr 2019 04:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3bu8sSj/St5z5A/eP0AMpKjvggaQ9cr9OipT1kkMzPs=; b=FKy5BGl6KmArpPlYrypEgU7w+7gaLQQFn61H0Cr8I7SW9dY9s0GUCsG67V7nxmikkv sGbyt7pq78VPDPtWYF+wf9aid5MKGm2Fi9tDyDf9hgYaLHrnD3PDUJAQT8NDSJHh/Zed EIdpVfue+bdWrRnFX1cvbF6F0J2WXSd3oCHVt9HFBCfh7N5rGrVRFvcfgBlD60toQIj7 NuJsCv9tg95+pE1qeiF25UrAyX2mBgCGGJKC6w2aYxFH555Horzz9AR1ERp3hT1TVMm5 jP2GXsKIz4350NiTihc/aUQnPkWPtJYTl9LSt8LIevOscFyOoYqSjfnuGkc6Kpwbz/Lv XVcw== 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=3bu8sSj/St5z5A/eP0AMpKjvggaQ9cr9OipT1kkMzPs=; b=AEL0KHwpwdwgif7xuR1dTiDL1Sty7X1FtkkWn9S528n5IHdiY2E0DZe1Br9TgqRKgV SqCstDClE3+m1b986mDcZNcb1cvurNNYtM5OmD+zFaxtF3d1Jb3THt2JfMNN3c1JkS9g qe3qQLvLAbo0ZvK3GIXNaB2y0H2Gi+ZI9hiWT3whfll131rDHziWFKQszk/j691Lrb1E qZPva6BejPClaYuCDSApNy1W7DeNfxSvS8/YEhUMr3Fkamb3wUgFlBYvJ8O2Mb8pM0Cb u5l287xs/49YLi6AM2x5SKQRxjTDkNGpLJ5LqAO884H+3km2liyatzIEwz0XpFp535kL zZbg== X-Gm-Message-State: APjAAAVMTRZFs4M8TkVDeIBGF/9vMWAEedmD4zF2NsVt9BDLlY/ioEfS tCpa4F59T9xfFgZVEBydaHchcA== X-Received: by 2002:adf:eaca:: with SMTP id o10mr3819260wrn.273.1554376670916; Thu, 04 Apr 2019 04:17:50 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id z23sm9024771wma.0.2019.04.04.04.17.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 04:17:50 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , Kevin Hilman , Maxime Jourdan , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 4/6] ASoC: meson: axg-frddr: add g12a support Date: Thu, 4 Apr 2019 13:17:31 +0200 Message-Id: <20190404111733.28705-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190404111733.28705-1-jbrunet@baylibre.com> References: <20190404111733.28705-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the axg, frddr could only be connected to 1 downstream element, so the playback was possible on 1 interface only at a time. On the g12a, the frddr may connect and wait for the request of up to 3 downstream elements. With this, it possible for single playback to be played on several interfaces at the same time. Like the toddr fifo, the g12a frddr also need to take care of resetting the read pointer to the initial fifo address when preparing a playback. Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-frddr.c | 143 +++++++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/sound/soc/meson/axg-frddr.c b/sound/soc/meson/axg-frddr.c index a6f6f6a2eca8..2b8807737b2b 100644 --- a/sound/soc/meson/axg-frddr.c +++ b/sound/soc/meson/axg-frddr.c @@ -3,7 +3,9 @@ // Copyright (c) 2018 BayLibre, SAS. // Author: Jerome Brunet -/* This driver implements the frontend playback DAI of AXG based SoCs */ +/* + * This driver implements the frontend playback DAI of AXG and G12A based SoCs + */ #include #include @@ -14,7 +16,29 @@ #include "axg-fifo.h" -#define CTRL0_FRDDR_PP_MODE BIT(30) +#define CTRL0_FRDDR_PP_MODE BIT(30) +#define CTRL0_SEL1_EN_SHIFT 3 +#define CTRL0_SEL2_SHIFT 4 +#define CTRL0_SEL2_EN_SHIFT 7 +#define CTRL0_SEL3_SHIFT 8 +#define CTRL0_SEL3_EN_SHIFT 11 +#define CTRL1_FRDDR_FORCE_FINISH BIT(12) + +static int g12a_frddr_dai_prepare(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct axg_fifo *fifo = snd_soc_dai_get_drvdata(dai); + + /* Reset the read pointer to the FIFO_INIT_ADDR */ + regmap_update_bits(fifo->map, FIFO_CTRL1, + CTRL1_FRDDR_FORCE_FINISH, 0); + regmap_update_bits(fifo->map, FIFO_CTRL1, + CTRL1_FRDDR_FORCE_FINISH, CTRL1_FRDDR_FORCE_FINISH); + regmap_update_bits(fifo->map, FIFO_CTRL1, + CTRL1_FRDDR_FORCE_FINISH, 0); + + return 0; +} static int axg_frddr_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) @@ -119,10 +143,123 @@ static const struct axg_fifo_match_data axg_frddr_match_data = { .dai_drv = &axg_frddr_dai_drv }; +static const struct snd_soc_dai_ops g12a_frddr_ops = { + .prepare = g12a_frddr_dai_prepare, + .startup = axg_frddr_dai_startup, + .shutdown = axg_frddr_dai_shutdown, +}; + +static struct snd_soc_dai_driver g12a_frddr_dai_drv = { + .name = "FRDDR", + .playback = { + .stream_name = "Playback", + .channels_min = 1, + .channels_max = AXG_FIFO_CH_MAX, + .rates = AXG_FIFO_RATES, + .formats = AXG_FIFO_FORMATS, + }, + .ops = &g12a_frddr_ops, + .pcm_new = axg_frddr_pcm_new, +}; + +static const char * const g12a_frddr_sel_texts[] = { + "OUT 0", "OUT 1", "OUT 2", "OUT 3", "OUT 4", +}; + +static SOC_ENUM_SINGLE_DECL(g12a_frddr_sel1_enum, FIFO_CTRL0, CTRL0_SEL_SHIFT, + g12a_frddr_sel_texts); +static SOC_ENUM_SINGLE_DECL(g12a_frddr_sel2_enum, FIFO_CTRL0, CTRL0_SEL2_SHIFT, + g12a_frddr_sel_texts); +static SOC_ENUM_SINGLE_DECL(g12a_frddr_sel3_enum, FIFO_CTRL0, CTRL0_SEL3_SHIFT, + g12a_frddr_sel_texts); + +static const struct snd_kcontrol_new g12a_frddr_out1_demux = + SOC_DAPM_ENUM("Output Src 1", g12a_frddr_sel1_enum); +static const struct snd_kcontrol_new g12a_frddr_out2_demux = + SOC_DAPM_ENUM("Output Src 2", g12a_frddr_sel2_enum); +static const struct snd_kcontrol_new g12a_frddr_out3_demux = + SOC_DAPM_ENUM("Output Src 3", g12a_frddr_sel3_enum); + +static const struct snd_kcontrol_new g12a_frddr_out1_enable = + SOC_DAPM_SINGLE_AUTODISABLE("Switch", FIFO_CTRL0, + CTRL0_SEL1_EN_SHIFT, 1, 0); +static const struct snd_kcontrol_new g12a_frddr_out2_enable = + SOC_DAPM_SINGLE_AUTODISABLE("Switch", FIFO_CTRL0, + CTRL0_SEL2_EN_SHIFT, 1, 0); +static const struct snd_kcontrol_new g12a_frddr_out3_enable = + SOC_DAPM_SINGLE_AUTODISABLE("Switch", FIFO_CTRL0, + CTRL0_SEL3_EN_SHIFT, 1, 0); + +static const struct snd_soc_dapm_widget g12a_frddr_dapm_widgets[] = { + SND_SOC_DAPM_AIF_OUT("SRC 1", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("SRC 2", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("SRC 3", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_SWITCH("SRC 1 EN", SND_SOC_NOPM, 0, 0, + &g12a_frddr_out1_enable), + SND_SOC_DAPM_SWITCH("SRC 2 EN", SND_SOC_NOPM, 0, 0, + &g12a_frddr_out2_enable), + SND_SOC_DAPM_SWITCH("SRC 3 EN", SND_SOC_NOPM, 0, 0, + &g12a_frddr_out3_enable), + SND_SOC_DAPM_DEMUX("SINK 1 SEL", SND_SOC_NOPM, 0, 0, + &g12a_frddr_out1_demux), + SND_SOC_DAPM_DEMUX("SINK 2 SEL", SND_SOC_NOPM, 0, 0, + &g12a_frddr_out2_demux), + SND_SOC_DAPM_DEMUX("SINK 3 SEL", SND_SOC_NOPM, 0, 0, + &g12a_frddr_out3_demux), + SND_SOC_DAPM_AIF_OUT("OUT 0", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 1", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 2", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 3", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 4", NULL, 0, SND_SOC_NOPM, 0, 0), +}; + +static const struct snd_soc_dapm_route g12a_frddr_dapm_routes[] = { + { "SRC 1", NULL, "Playback" }, + { "SRC 2", NULL, "Playback" }, + { "SRC 3", NULL, "Playback" }, + { "SRC 1 EN", "Switch", "SRC 1" }, + { "SRC 2 EN", "Switch", "SRC 2" }, + { "SRC 3 EN", "Switch", "SRC 3" }, + { "SINK 1 SEL", NULL, "SRC 1 EN" }, + { "SINK 2 SEL", NULL, "SRC 2 EN" }, + { "SINK 3 SEL", NULL, "SRC 3 EN" }, + { "OUT 0", "OUT 0", "SINK 1 SEL" }, + { "OUT 1", "OUT 1", "SINK 1 SEL" }, + { "OUT 2", "OUT 2", "SINK 1 SEL" }, + { "OUT 3", "OUT 3", "SINK 1 SEL" }, + { "OUT 4", "OUT 4", "SINK 1 SEL" }, + { "OUT 0", "OUT 0", "SINK 2 SEL" }, + { "OUT 1", "OUT 1", "SINK 2 SEL" }, + { "OUT 2", "OUT 2", "SINK 2 SEL" }, + { "OUT 3", "OUT 3", "SINK 2 SEL" }, + { "OUT 4", "OUT 4", "SINK 2 SEL" }, + { "OUT 0", "OUT 0", "SINK 3 SEL" }, + { "OUT 1", "OUT 1", "SINK 3 SEL" }, + { "OUT 2", "OUT 2", "SINK 3 SEL" }, + { "OUT 3", "OUT 3", "SINK 3 SEL" }, + { "OUT 4", "OUT 4", "SINK 3 SEL" }, +}; + +static const struct snd_soc_component_driver g12a_frddr_component_drv = { + .dapm_widgets = g12a_frddr_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(g12a_frddr_dapm_widgets), + .dapm_routes = g12a_frddr_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(g12a_frddr_dapm_routes), + .ops = &g12a_fifo_pcm_ops +}; + +static const struct axg_fifo_match_data g12a_frddr_match_data = { + .component_drv = &g12a_frddr_component_drv, + .dai_drv = &g12a_frddr_dai_drv +}; + static const struct of_device_id axg_frddr_of_match[] = { { .compatible = "amlogic,axg-frddr", .data = &axg_frddr_match_data, + }, { + .compatible = "amlogic,g12a-frddr", + .data = &g12a_frddr_match_data, }, {} }; MODULE_DEVICE_TABLE(of, axg_frddr_of_match); @@ -136,6 +273,6 @@ static struct platform_driver axg_frddr_pdrv = { }; module_platform_driver(axg_frddr_pdrv); -MODULE_DESCRIPTION("Amlogic AXG playback fifo driver"); +MODULE_DESCRIPTION("Amlogic AXG/G12A playback fifo driver"); MODULE_AUTHOR("Jerome Brunet "); MODULE_LICENSE("GPL v2"); From patchwork Thu Apr 4 11:17:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 161782 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1465984jan; Thu, 4 Apr 2019 04:18:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFaXaoOYhZtqCSYCL/i9WPwI+IpKbdpHzr1NVS1WaZsaehuPnWU0zwtGmWsbcVKHiLdY7d X-Received: by 2002:aa7:9392:: with SMTP id t18mr5294573pfe.45.1554376684643; Thu, 04 Apr 2019 04:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554376684; cv=none; d=google.com; s=arc-20160816; b=p1Vut0M70R7FC5hzXLRS38rQpNgnAAA84Ab2KHKadiSM2TwFNq4UyffFFADuS5vNNK gNCiGyBr2GleriUODr8ckXFsVsjWiHvpyHWdEKecShAoVPUQCa0xvHZ3gh5D7DcqJqvV QeAMUdOYcdFFmRk35TZ4VOfaVVPQxFKldepMyEodHmGw2POyGeMLylhqECkOgW6AVVO9 QQ+BgFESoduwAOAYgbs7dPX+yohxcbAoVaRI0ZhOlYkZg9VKoSKRm76mdTwfEb6n5CU+ TCPAxGskCsARos7YyM/yW2qXUQmWNy+Q/41gYYW/qhJ03zaMp9hkXmoxwAzdYupE1gN9 GD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2Vn9RR550Eyl4ELYsr1mmHgCuBIbCpOqQ6bfLv4sARg=; b=htQZ0qADso8SoWcgHpVi8FG+5iGZuyUnQGSny5kNDFwHG1l7pJvsD4OalJNClTpPqI fryZw0NS2q6gh6zAZsL0pFPm43Vzy8U9Z/Q4KKcUw73n70m0jgU1mhLGnLDCKGcpRH3U IK36ScpsDbYGz6gkoO2Uv3Cpgu4Qg/5g39A7G6D3cAvLKWRtCjRiHlaE5xNukt39tQpw shp8M1nY4UlzJGBss89VSWDTRdrdDchWkLC6OUkytk3SWXMk/vzg3FGmixkScC6FyzBG MaQQOCQOB7lJFib/RGP4U6DyHJffXsopQVe1bDgWVlZDUP/Pl65VShBB9BmfKnaquqek hMQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=uWRc+fU0; 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 g59si16847286plb.281.2019.04.04.04.18.04; Thu, 04 Apr 2019 04:18:04 -0700 (PDT) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=uWRc+fU0; 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 S1729754AbfDDLSD (ORCPT + 31 others); Thu, 4 Apr 2019 07:18:03 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54626 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729657AbfDDLR4 (ORCPT ); Thu, 4 Apr 2019 07:17:56 -0400 Received: by mail-wm1-f65.google.com with SMTP id c1so2558056wml.4 for ; Thu, 04 Apr 2019 04:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2Vn9RR550Eyl4ELYsr1mmHgCuBIbCpOqQ6bfLv4sARg=; b=uWRc+fU0O+nKHBDEQJJXZ7Z2j7snQLXa/BT8codA7325VHzO8/xA/fSJHg2ARzNjtb sDQrVIfah0PZxPEavE4ijLEa12EnW7HzSY1MER2Ey8l1qtZVnwIHbVZuFiK5zxAZRoao DiBgtqs07mEyREAAd4ip1Ixy5fNWyhexonV5VEPCfOfhj/emGycOHa1kGym4ppaIk7FF ju/44J11q9bIq6xFUh1QMaBcp1V6Ql2U2j/rA+5uY5Ta2bIOBJ7Jco9Dr5Ly1TeLaFzF Uo5HPCCGTjhERrzBEU0ocbptHeOMQ/OPdWeALZZg8ZYI2JfpzusG6VVDFfYls2O5JEQb vUOw== 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=2Vn9RR550Eyl4ELYsr1mmHgCuBIbCpOqQ6bfLv4sARg=; b=D0SI4VSbtgU+EJk1ydkUFL/+pDBEAGTltFxP5RUsWYJ18lMyKS8WnwKXlmSQCjyng9 vEwIJGIFT1iFkNvn76Lv4QIOWmnjIyPYiUEg2KC4zWPLEoree4OCFIEwuXLjk1kRjL01 a/9Xao3Q1LAgrgFLgPle0XJbe6Lke6OOScR3VPomNRc74dlbkkoWbkbYP3IwQYdHAVRu M796lmRI5b9VtGIL+MOeDqa87iMmerUzGG91+5lLZje59UKY3RUu6GigO+BzJkNwm6+r itP/cMuUD2PRkHHRFaiMff/TfJq8g14EXZ+CgiFpoVQ3bDrHu9EHTYj8SEAR1V/9Oba8 r+xw== X-Gm-Message-State: APjAAAWwrXB1tXyG9TyfYMjqtP73ZZn+HARvKbRf2NT8t38OO2pdtNfz 3CpgcqKHwwOadIXj8efv09Mrqg== X-Received: by 2002:a7b:c923:: with SMTP id h3mr3611271wml.34.1554376674104; Thu, 04 Apr 2019 04:17:54 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id z23sm9024771wma.0.2019.04.04.04.17.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 04:17:53 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , Kevin Hilman , Maxime Jourdan , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 6/6] ASoC: meson: axg-tdmout: add g12a support Date: Thu, 4 Apr 2019 13:17:33 +0200 Message-Id: <20190404111733.28705-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190404111733.28705-1-jbrunet@baylibre.com> References: <20190404111733.28705-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The axg tdmout driver just need a different skew offset to operate correctly on the g12a SoC family. Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-tdmout.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.20.1 diff --git a/sound/soc/meson/axg-tdmout.c b/sound/soc/meson/axg-tdmout.c index 3984818e2a7c..527bfc4487e0 100644 --- a/sound/soc/meson/axg-tdmout.c +++ b/sound/soc/meson/axg-tdmout.c @@ -243,10 +243,23 @@ static const struct axg_tdm_formatter_driver axg_tdmout_drv = { }, }; +static const struct axg_tdm_formatter_driver g12a_tdmout_drv = { + .component_drv = &axg_tdmout_component_drv, + .regmap_cfg = &axg_tdmout_regmap_cfg, + .ops = &axg_tdmout_ops, + .quirks = &(const struct axg_tdm_formatter_hw) { + .invert_sclk = true, + .skew_offset = 2, + }, +}; + static const struct of_device_id axg_tdmout_of_match[] = { { .compatible = "amlogic,axg-tdmout", .data = &axg_tdmout_drv, + }, { + .compatible = "amlogic,g12a-tdmout", + .data = &g12a_tdmout_drv, }, {} }; MODULE_DEVICE_TABLE(of, axg_tdmout_of_match);