Received: by 10.192.165.148 with SMTP id m20csp2279643imm; Sun, 6 May 2018 10:57:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqu90B7m/GA99xrC+/aY9AAvg0//w5RMaGfDY6Y/fKRkd/dBZ7vPbBOaWzCji6k4YAK9iK0 X-Received: by 2002:a65:56c2:: with SMTP id w2-v6mr13457783pgs.381.1525629440929; Sun, 06 May 2018 10:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525629440; cv=none; d=google.com; s=arc-20160816; b=nLLDK1fiNXNUcIS/qK57xE0/VFfu9cXsQuVdVp0Vd6sxaUx6bblZBP9b6Lq30daF1w N4syitt4mUd4QrsrYGM4Jv/7aHbZNDUeIicNJL/CiuVjIP/hcfLV9/+Agxu7+agKVjqU Y4Pf7UPLazI7uwDeJOjJDqRzCvoZGoRcxIJSHqM5RvBvEnQugY2FifDmLJVTYkC/3Jnm hblFqV+cfreA6Wxuai72oZfJC4MdYyA29wFnO4ED80JEgeuRnFxImTslYG3J+wg3x7Gv lBIoMpsPg/hCy3XuZEycPZPDW7xtfpLzCbuEIdIpsp5Fj/prSG8F0BJYlfTHSA3bZhpU 323A== 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:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=hJALHMqoQk/b+b3cbDFPlXAKC/avg75ahWuRa5tnFLc=; b=HgL8f5qlYLmiHEMGquB0TKvA9HI7f10oFJsTR6hStlP0Fh8tMRm9WKujwfuoanszEA R7dKy8N321qK06Flf992TcbJUl2PRitW6Jf9iXbr1Cj/W+M/uBO/tfXemsAFXoOHfRAK XZi6MBjFuq4bXJBDS2Zab8OZkXx0/BkZS/UzuzC1IswV1xHZMbqipFzDzEUp39oWJ0qX iiPSR2EkbvA/RCguUDoBIKePIB5NuIyptl/c9bO3lcCpwi6DoKSLDi/akIhq9V88uQjY C151Qveods8Zo0T4cQitBda59el9E8GDv1zOzjcjxKCmwn5kMXneb6R1jcUR8kpXEJAi 3I2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nGBw2+SE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11-v6si17830948pln.163.2018.05.06.10.57.05; Sun, 06 May 2018 10:57:20 -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=@kernel.org header.s=default header.b=nGBw2+SE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbeEFR4v (ORCPT + 99 others); Sun, 6 May 2018 13:56:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:53134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766AbeEFR4o (ORCPT ); Sun, 6 May 2018 13:56:44 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F21B020C48; Sun, 6 May 2018 17:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525629404; bh=NCgubZNhdcZ0NxkGud9mp7gXjt/Yx06q1nRlsmLvvN0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nGBw2+SE8DbOelGVoXwvNOoR38sguPfVrRDbFq3D/qRXu8O03qx4T0e3AmPVm5HlG 54E02+05nFmlvMWbHIh472IMvRGuw/mzznNZYPuPvPTi9FzKO2pZ95L2gIj2MBrUCk hcx+YSGoJ6R0/5dOra8pRKN3GaYUgWRxSuAWl54E= Date: Sun, 6 May 2018 18:56:37 +0100 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , , , , Subject: Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1 Message-ID: <20180506185637.494494b3@archlinux> In-Reply-To: <1525266323-4922-1-git-send-email-fabrice.gasnier@st.com> References: <1525266323-4922-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 May 2018 15:05:23 +0200 Fabrice Gasnier wrote: > Add support for DFSDM (Digital Filter For Sigma Delta Modulators) > to STM32MP1. This variant is close to STM32H7 DFSDM, it implements > 6 filter instances. Registers map is also increased. > > Signed-off-by: Fabrice Gasnier Looks good to me. I'd like to give a little more time for others to comment however. Give me a poke if I seem to have forgotten about it. Jonathan > --- > .../bindings/iio/adc/st,stm32-dfsdm-adc.txt | 7 +++++-- > drivers/iio/adc/stm32-dfsdm-core.c | 21 +++++++++++++++++++++ > 2 files changed, 26 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt > index ed7520d..75ba25d 100644 > --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt > +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt > @@ -8,14 +8,16 @@ It is mainly targeted for: > - PDM microphones (audio digital microphone) > > It features up to 8 serial digital interfaces (SPI or Manchester) and > -up to 4 filters on stm32h7. > +up to 4 filters on stm32h7 or 6 filters on stm32mp1. > > Each child node match with a filter instance. > > Contents of a STM32 DFSDM root node: > ------------------------------------ > Required properties: > -- compatible: Should be "st,stm32h7-dfsdm". > +- compatible: Should be one of: > + "st,stm32h7-dfsdm" > + "st,stm32mp1-dfsdm" > - reg: Offset and length of the DFSDM block register set. > - clocks: IP and serial interfaces clocking. Should be set according > to rcc clock ID and "clock-names". > @@ -45,6 +47,7 @@ Required properties: > "st,stm32-dfsdm-adc" for sigma delta ADCs > "st,stm32-dfsdm-dmic" for audio digital microphone. > - reg: Specifies the DFSDM filter instance used. > + Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1. > - interrupts: IRQ lines connected to each DFSDM filter instance. > - st,adc-channels: List of single-ended channels muxed for this ADC. > valid values: > diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c > index e50efdc..d924e6c 100644 > --- a/drivers/iio/adc/stm32-dfsdm-core.c > +++ b/drivers/iio/adc/stm32-dfsdm-core.c > @@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data { > > #define STM32H7_DFSDM_NUM_FILTERS 4 > #define STM32H7_DFSDM_NUM_CHANNELS 8 > +#define STM32MP1_DFSDM_NUM_FILTERS 6 > +#define STM32MP1_DFSDM_NUM_CHANNELS 8 > > static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg) > { > @@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg) > .regmap_cfg = &stm32h7_dfsdm_regmap_cfg, > }; > > +static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = { > + .reg_bits = 32, > + .val_bits = 32, > + .reg_stride = sizeof(u32), > + .max_register = 0x7fc, > + .volatile_reg = stm32_dfsdm_volatile_reg, > + .fast_io = true, > +}; > + > +static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = { > + .num_filters = STM32MP1_DFSDM_NUM_FILTERS, > + .num_channels = STM32MP1_DFSDM_NUM_CHANNELS, > + .regmap_cfg = &stm32mp1_dfsdm_regmap_cfg, > +}; > + > struct dfsdm_priv { > struct platform_device *pdev; /* platform device */ > > @@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev, > .compatible = "st,stm32h7-dfsdm", > .data = &stm32h7_dfsdm_data, > }, > + { > + .compatible = "st,stm32mp1-dfsdm", > + .data = &stm32mp1_dfsdm_data, > + }, > {} > }; > MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);