From patchwork Sat Nov 28 22:28:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11F72C63798 for ; Sat, 28 Nov 2020 22:30:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADB41221FD for ; Sat, 28 Nov 2020 22:30:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NULji2V7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADB41221FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uAnnXA0Mt8NwzygOV6fDnrQzslciP0Ou160orDl0LPc=; b=NULji2V7U6m/47XqbQc2UcfWb uHYSVHDWNSBf+VtkZRLwUnxQ+gBCbMjvCtQ6jvSJqwPyIGSZkBX0injyf2UF7xauN74Q9LO+zedPG ao66hFQHH+SUheLUWKH8Uj2qDu/y1lEQToBYl4wq3H52WtnYRp5oZXjiweFXLnGT7afCDLU+meJ6v y5XECAIujfPRUByUlGp/kMRNe7VgVRz7qmLAHQ65jHDL/cIv4S7cPOT5C3W+s1+wqLqAmSKdBz8oz uZ7BPDEchsKUwHR5qc7iM4tc9+uzFDPUJRbG2BrQqbXQHjR1cyCodapRWCIX7eaapWocOCbfT7mQJ QktLM/1uQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hp-00080x-43; Sat, 28 Nov 2020 22:28:37 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hj-0007yl-RZ for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:32 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 706ED60004; Sat, 28 Nov 2020 22:28:27 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 01/10] iio: adc: at91_adc: remove at91_adc_ids Date: Sat, 28 Nov 2020 23:28:09 +0100 Message-Id: <20201128222818.1910764-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172832_040133_11F997EE X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver is DT only since commit ead1c9f376db ("iio: adc: at91_adc: remove platform data and move defs in driver file"). Remove the leftover platform_device_id array. Signed-off-by: Alexandre Belloni --- drivers/iio/adc/at91_adc.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 601708168082..8501f3aeeb4e 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -1425,29 +1425,9 @@ static const struct of_device_id at91_adc_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, at91_adc_dt_ids); -static const struct platform_device_id at91_adc_ids[] = { - { - .name = "at91sam9260-adc", - .driver_data = (unsigned long)&at91sam9260_caps, - }, { - .name = "at91sam9rl-adc", - .driver_data = (unsigned long)&at91sam9rl_caps, - }, { - .name = "at91sam9g45-adc", - .driver_data = (unsigned long)&at91sam9g45_caps, - }, { - .name = "at91sam9x5-adc", - .driver_data = (unsigned long)&at91sam9x5_caps, - }, { - /* terminator */ - } -}; -MODULE_DEVICE_TABLE(platform, at91_adc_ids); - static struct platform_driver at91_adc_driver = { .probe = at91_adc_probe, .remove = at91_adc_remove, - .id_table = at91_adc_ids, .driver = { .name = DRIVER_NAME, .of_match_table = at91_adc_dt_ids, From patchwork Sat Nov 28 22:28:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 066ADC63798 for ; Sat, 28 Nov 2020 22:30:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0AFA21D40 for ; Sat, 28 Nov 2020 22:30:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l9QsHH8r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0AFA21D40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=13ySArkvwoi8pa8XuO3pUX6npqvdqdx2t5uH3jm0i2w=; b=l9QsHH8rng39f3HPg/hyinDwT Q6C0av9y4vxIMK0trEeqoF8VLhbd9UeRY/QHl7jhmIcZJfKvlqCRAoiRc603DNTjL4Qov0ObU9epU IRzen6Yz3dfvpEXCHQlzVSixh2KaPCpet6rAEoS7tYUullWN4wts6apUYMMZf4Fv0FE0zlBV05+eU wrW0k7UrC4p+HNobsBbi1g5Mp8NZRv9H2hdpidIDWW1hfe2S8CphL0cwYwLJqAVatajci2E+hPAXM rY3cifD4uSkW3dsg8tQ0k/lG8YcaGDdYgEJwPdZDCqSni1e4HnfbzKRDKW8zeQFBgoFoEgXX7/Hfu Dk/ioNkhw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8i2-000853-IR; Sat, 28 Nov 2020 22:28:50 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hk-0007zD-JJ for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:34 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id A50F5C0002; Sat, 28 Nov 2020 22:28:29 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 02/10] iio: adc: at91_adc: rework resolution selection Date: Sat, 28 Nov 2020 23:28:10 +0100 Message-Id: <20201128222818.1910764-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172832_893522_A3E67928 X-CRM114-Status: GOOD ( 19.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the possible resolution values back to the driver. This removes the atmel,adc-res and atmel,adc-res-names properties, leaving only atmel,adc-use-res. As atmel,adc-res-names had to contain "lowres" and "highres", those where already the only allowed values for atmel,adc-use-res. Also introduce a new compatible string for the sama5d3 as this is the only one with a different resolution. Also it doesn't even have the LOWRES bit. Signed-off-by: Alexandre Belloni Reviewed-by: Ludovic Desroches --- drivers/iio/adc/at91_adc.c | 97 ++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 8501f3aeeb4e..171288a4ab9a 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -204,6 +204,9 @@ struct at91_adc_caps { u32 (*calc_startup_ticks)(u32 startup_time, u32 adc_clk_khz); u8 num_channels; + + u8 low_res_bits; + u8 high_res_bits; struct at91_adc_reg_desc registers; }; @@ -229,7 +232,6 @@ struct at91_adc_state { bool use_external; u32 vref_mv; u32 res; /* resolution used for convertions */ - bool low_res; /* the resolution corresponds to the lowest one */ wait_queue_head_t wq_data_avail; const struct at91_adc_caps *caps; @@ -754,58 +756,6 @@ static int at91_adc_read_raw(struct iio_dev *idev, return -EINVAL; } -static int at91_adc_of_get_resolution(struct iio_dev *idev, - struct platform_device *pdev) -{ - struct at91_adc_state *st = iio_priv(idev); - struct device_node *np = pdev->dev.of_node; - int count, i, ret = 0; - char *res_name, *s; - u32 *resolutions; - - count = of_property_count_strings(np, "atmel,adc-res-names"); - if (count < 2) { - dev_err(&idev->dev, "You must specified at least two resolution names for " - "adc-res-names property in the DT\n"); - return count; - } - - resolutions = kmalloc_array(count, sizeof(*resolutions), GFP_KERNEL); - if (!resolutions) - return -ENOMEM; - - if (of_property_read_u32_array(np, "atmel,adc-res", resolutions, count)) { - dev_err(&idev->dev, "Missing adc-res property in the DT.\n"); - ret = -ENODEV; - goto ret; - } - - if (of_property_read_string(np, "atmel,adc-use-res", (const char **)&res_name)) - res_name = "highres"; - - for (i = 0; i < count; i++) { - if (of_property_read_string_index(np, "atmel,adc-res-names", i, (const char **)&s)) - continue; - - if (strcmp(res_name, s)) - continue; - - st->res = resolutions[i]; - if (!strcmp(res_name, "lowres")) - st->low_res = true; - else - st->low_res = false; - - dev_info(&idev->dev, "Resolution used: %u bits\n", st->res); - goto ret; - } - - dev_err(&idev->dev, "There is no resolution for %s\n", res_name); - -ret: - kfree(resolutions); - return ret; -} static u32 calc_startup_ticks_9260(u32 startup_time, u32 adc_clk_khz) { @@ -889,6 +839,7 @@ static int at91_adc_probe_dt(struct iio_dev *idev, struct device_node *trig_node; int i = 0, ret; u32 prop; + char *s; st->caps = of_device_get_match_data(&pdev->dev); @@ -921,9 +872,13 @@ static int at91_adc_probe_dt(struct iio_dev *idev, } st->vref_mv = prop; - ret = at91_adc_of_get_resolution(idev, pdev); - if (ret) - goto error_ret; + st->res = st->caps->high_res_bits; + if (st->caps->low_res_bits && + !of_property_read_string(node, "atmel,adc-use-res", (const char **)&s) + && !strcmp(s, "lowres")) + st->res = st->caps->low_res_bits; + + dev_info(&idev->dev, "Resolution used: %u bits\n", st->res); st->registers = &st->caps->registers; st->num_channels = st->caps->num_channels; @@ -1245,7 +1200,7 @@ static int at91_adc_probe(struct platform_device *pdev) reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask; - if (st->low_res) + if (st->res == st->caps->low_res_bits) reg |= AT91_ADC_LOWRES; if (st->sleep_mode) reg |= AT91_ADC_SLEEP; @@ -1360,6 +1315,8 @@ static SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, at91_adc_resume); static struct at91_adc_caps at91sam9260_caps = { .calc_startup_ticks = calc_startup_ticks_9260, .num_channels = 4, + .low_res_bits = 8, + .high_res_bits = 10, .registers = { .channel_base = AT91_ADC_CHR(0), .drdy_mask = AT91_ADC_DRDY, @@ -1374,6 +1331,8 @@ static struct at91_adc_caps at91sam9rl_caps = { .has_ts = true, .calc_startup_ticks = calc_startup_ticks_9260, /* same as 9260 */ .num_channels = 6, + .low_res_bits = 8, + .high_res_bits = 10, .registers = { .channel_base = AT91_ADC_CHR(0), .drdy_mask = AT91_ADC_DRDY, @@ -1388,6 +1347,8 @@ static struct at91_adc_caps at91sam9g45_caps = { .has_ts = true, .calc_startup_ticks = calc_startup_ticks_9260, /* same as 9260 */ .num_channels = 8, + .low_res_bits = 8, + .high_res_bits = 10, .registers = { .channel_base = AT91_ADC_CHR(0), .drdy_mask = AT91_ADC_DRDY, @@ -1405,6 +1366,8 @@ static struct at91_adc_caps at91sam9x5_caps = { .ts_pen_detect_sensitivity = 2, .calc_startup_ticks = calc_startup_ticks_9x5, .num_channels = 12, + .low_res_bits = 8, + .high_res_bits = 10, .registers = { .channel_base = AT91_ADC_CDR0_9X5, .drdy_mask = AT91_ADC_SR_DRDY_9X5, @@ -1416,11 +1379,31 @@ static struct at91_adc_caps at91sam9x5_caps = { }, }; +static struct at91_adc_caps sama5d3_caps = { + .has_ts = true, + .has_tsmr = true, + .ts_filter_average = 3, + .ts_pen_detect_sensitivity = 2, + .calc_startup_ticks = calc_startup_ticks_9x5, + .num_channels = 12, + .low_res_bits = 0, + .high_res_bits = 12, + .registers = { + .channel_base = AT91_ADC_CDR0_9X5, + .drdy_mask = AT91_ADC_SR_DRDY_9X5, + .status_register = AT91_ADC_SR_9X5, + .trigger_register = AT91_ADC_TRGR_9X5, + .mr_prescal_mask = AT91_ADC_PRESCAL_9G45, + .mr_startup_mask = AT91_ADC_STARTUP_9X5, + }, +}; + static const struct of_device_id at91_adc_dt_ids[] = { { .compatible = "atmel,at91sam9260-adc", .data = &at91sam9260_caps }, { .compatible = "atmel,at91sam9rl-adc", .data = &at91sam9rl_caps }, { .compatible = "atmel,at91sam9g45-adc", .data = &at91sam9g45_caps }, { .compatible = "atmel,at91sam9x5-adc", .data = &at91sam9x5_caps }, + { .compatible = "atmel,sama5d3-adc", .data = &sama5d3_caps }, {}, }; MODULE_DEVICE_TABLE(of, at91_adc_dt_ids); From patchwork Sat Nov 28 22:28:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0945C63777 for ; Sat, 28 Nov 2020 22:30:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6228921D40 for ; Sat, 28 Nov 2020 22:30:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mmWz/JdY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6228921D40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6ouBy43GNr7s26jCP3dAl20CXC9044TTm5JOlm5/9zI=; b=mmWz/JdYebmvlftxDx4sio+8K KFTRThY8J5tlWSMbeYxT1xeqjugRIkyKuwpweksBb1nwsCy94jDF3Lkx9jpeBhNa30JqXepZsfHo5 23R5WV5eIdsODKIR0rim8waeTiee1ZCE+fbZ4ScmVnwsWNKP1GRNQWbSD39bQCkla5Ixur7t+8oIn LxlFdzO0GxY5IZ46Rb76/bzjP/F2rmJZyK0yktl8KldW5qqsHqKAGeOHJyEJX66G/q6zmlIxAQYAN 2IaOci324RE6eV/1eblgT06IFjvjgxvDggrVTXnfaHylHwn1U6h65uJ/CkGfJgmx8miyzk6SRQ4r1 l4QRiCvkA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hx-00084C-PT; Sat, 28 Nov 2020 22:28:46 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hk-0007zF-JF for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:34 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id E1DF2C0003; Sat, 28 Nov 2020 22:28:30 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 03/10] dt-bindings:iio:adc:remove atmel, adc-res and atmel, adc-res-names Date: Sat, 28 Nov 2020 23:28:11 +0100 Message-Id: <20201128222818.1910764-4-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172832_781878_362634C6 X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Rob Herring , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove atmel,adc-res and atmel,adc-res-names as they are not necessary and are handled by the driver. Also add sama5d3 to the list of possible chips. Cc: Rob Herring Signed-off-by: Alexandre Belloni Reviewed-by: Rob Herring --- .../devicetree/bindings/iio/adc/at91_adc.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/at91_adc.txt b/Documentation/devicetree/bindings/iio/adc/at91_adc.txt index f65b04fb7962..da393ac5c05f 100644 --- a/Documentation/devicetree/bindings/iio/adc/at91_adc.txt +++ b/Documentation/devicetree/bindings/iio/adc/at91_adc.txt @@ -2,7 +2,7 @@ Required properties: - compatible: Should be "atmel,-adc" - can be "at91sam9260", "at91sam9g45" or "at91sam9x5" + can be "at91sam9260", "at91sam9g45", "at91sam9x5" or "sama5d3" - reg: Should contain ADC registers location and length - interrupts: Should contain the IRQ line for the ADC - clock-names: tuple listing input clock names. @@ -13,17 +13,12 @@ Required properties: - atmel,adc-startup-time: Startup Time of the ADC in microseconds as defined in the datasheet - atmel,adc-vref: Reference voltage in millivolts for the conversions - - atmel,adc-res: List of resolutions in bits supported by the ADC. List size - must be two at least. - - atmel,adc-res-names: Contains one identifier string for each resolution - in atmel,adc-res property. "lowres" and "highres" - identifiers are required. Optional properties: - atmel,adc-use-external-triggers: Boolean to enable the external triggers - - atmel,adc-use-res: String corresponding to an identifier from - atmel,adc-res-names property. If not specified, the highest - resolution will be used. + - atmel,adc-use-res: String selecting the resolution, can be "lowres" or + "highres". If not specified, the highest resolution will + be used. - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds - atmel,adc-ts-wires: Number of touchscreen wires. Should be 4 or 5. If this From patchwork Sat Nov 28 22:28:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 538A7C63798 for ; Sat, 28 Nov 2020 22:31:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01AD121D40 for ; Sat, 28 Nov 2020 22:31:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wwp+zC6a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01AD121D40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QCjvteZRPTvJTjvnSgcDEIeIPD4urSMKiU64emIIEEM=; b=wwp+zC6arfYiKxujS9sJEicC5 BCsDuH8tsZxZOiZLlmndaLgw09ke+VWT33Ck04W3MvVQSohPaag+TqLX7msC3LgAUtN4ZnRCufnzC oxEKh0tY7OQrxm/k0XeXcTmoDACLklaB8fYDVaAMeSL0cWZ2yVaRK+urDex8DZNIMdlSSbDm8DMd8 BzD7s1bnhbFMtqC3DL6nNmjidCWwujIzHK14ouWPSDAv1Dyxh3om5sGPPYpvGSDvyOGlwkUYini+m srexSbKleIeHEn6S1rVbMCYkR8QSKUe/VyLGYVU4okX4CTHuCs0NJ0/gBR1n+zu0YPTlsJVnC0Nud M7aN+iTTw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8iX-0008EX-6T; Sat, 28 Nov 2020 22:29:21 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hq-00080g-Lw for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:43 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E933720006; Sat, 28 Nov 2020 22:28:31 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 04/10] dt-bindings:iio:adc:atmel, sama9260-adc: conversion to yaml from at91_adc.txt Date: Sat, 28 Nov 2020 23:28:12 +0100 Message-Id: <20201128222818.1910764-5-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172839_183553_3DEF28C2 X-CRM114-Status: GOOD ( 19.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , Rob Herring , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , Jonathan Cameron , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jonathan Cameron There are a few things we would do differently in an ADC binding if we were starting from scratch but we are stuck with what we have (which made sense back when this was written!) We may be able to tighten up some elements of this binding in the future by careful checking of what values properties can actually take. Signed-off-by: Jonathan Cameron Cc: Alexandre Belloni Cc: Nicolas Ferre Cc: Ludovic Desroches [Alexandre Belloni: add sama5d3, remove atmel,adc-res and atmel,adc-res-names] Signed-off-by: Alexandre Belloni Reviewed-by: Rob Herring Reviewed-by: Ludovic Desroches --- .../devicetree/bindings/iio/adc/at91_adc.txt | 78 -------- .../bindings/iio/adc/atmel,sama9260-adc.yaml | 167 ++++++++++++++++++ 2 files changed, 167 insertions(+), 78 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/adc/at91_adc.txt create mode 100644 Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/at91_adc.txt b/Documentation/devicetree/bindings/iio/adc/at91_adc.txt deleted file mode 100644 index da393ac5c05f..000000000000 --- a/Documentation/devicetree/bindings/iio/adc/at91_adc.txt +++ /dev/null @@ -1,78 +0,0 @@ -* AT91's Analog to Digital Converter (ADC) - -Required properties: - - compatible: Should be "atmel,-adc" - can be "at91sam9260", "at91sam9g45", "at91sam9x5" or "sama5d3" - - reg: Should contain ADC registers location and length - - interrupts: Should contain the IRQ line for the ADC - - clock-names: tuple listing input clock names. - Required elements: "adc_clk", "adc_op_clk". - - clocks: phandles to input clocks. - - atmel,adc-channels-used: Bitmask of the channels muxed and enabled for this - device - - atmel,adc-startup-time: Startup Time of the ADC in microseconds as - defined in the datasheet - - atmel,adc-vref: Reference voltage in millivolts for the conversions - -Optional properties: - - atmel,adc-use-external-triggers: Boolean to enable the external triggers - - atmel,adc-use-res: String selecting the resolution, can be "lowres" or - "highres". If not specified, the highest resolution will - be used. - - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion - - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds - - atmel,adc-ts-wires: Number of touchscreen wires. Should be 4 or 5. If this - value is set, then the adc driver will enable touchscreen - support. - NOTE: when adc touchscreen is enabled, the adc hardware trigger will be - disabled. Since touchscreen will occupy the trigger register. - - atmel,adc-ts-pressure-threshold: a pressure threshold for touchscreen. It - makes touch detection more precise. - -Optional trigger Nodes: - - Required properties: - * trigger-name: Name of the trigger exposed to the user - * trigger-value: Value to put in the Trigger register - to activate this trigger - - Optional properties: - * trigger-external: Is the trigger an external trigger? - -Examples: -adc0: adc@fffb0000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "atmel,at91sam9260-adc"; - reg = <0xfffb0000 0x100>; - interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; - clocks = <&adc_clk>, <&adc_op_clk>; - clock-names = "adc_clk", "adc_op_clk"; - atmel,adc-channels-used = <0xff>; - atmel,adc-startup-time = <40>; - atmel,adc-use-external-triggers; - atmel,adc-vref = <3300>; - atmel,adc-res = <8 10>; - atmel,adc-res-names = "lowres", "highres"; - atmel,adc-use-res = "lowres"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; -}; diff --git a/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml b/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml new file mode 100644 index 000000000000..9b0ff59e75de --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml @@ -0,0 +1,167 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/atmel,sama9260-adc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AT91 sama9260 and similar Analog to Digital Converter (ADC) + +maintainers: + - Alexandre Belloni + +properties: + compatible: + enum: + - atmel,at91sam9260-adc + - atmel,at91sam9rl-adc + - atmel,at91sam9g45-adc + - atmel,at91sam9x5-adc + - atmel,at91sama5d3-adc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2 + maxItems: 2 + + clock-names: + items: + - const: adc_clk + - const: adc_op_clk + + atmel,adc-channels-used: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Bitmask of the channels muxed and enabled for this device + + atmel,adc-startup-time: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Startup Time of the ADC in microseconds as defined in the datasheet + + atmel,adc-vref: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Reference voltage in millivolts for the conversions + + atmel,adc-use-external-triggers: + $ref: /schemas/types.yaml#/definitions/flag + description: Enable the external triggers + + atmel,adc-use-res: + $ref: /schemas/types.yaml#/definitions/string + description: + String corresponding to an identifier from atmel,adc-res-names property. + If not specified, the highest resolution will be used. + enum: + - "lowres" + - "highres" + + atmel,adc-sleep-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: Enable sleep mode when no conversion + + atmel,adc-sample-hold-time: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Sample and Hold Time in microseconds + + atmel,adc-ts-wires: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Number of touchscreen wires. Must be set to enable touchscreen. + NOTE: when adc touchscreen is enabled, the adc hardware trigger will be + disabled. Since touchscreen will occupy the trigger register. + enum: + - 4 + - 5 + + atmel,adc-ts-pressure-threshold: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Pressure threshold for touchscreen. + + "#io-channel-cells": + const: 1 + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - atmel,adc-channels-used + - atmel,adc-startup-time + - atmel,adc-vref + +patternProperties: + "^(trigger)[0-9]$": + type: object + description: Child node to describe a trigger exposed to the user. + properties: + trigger-name: + $ref: /schemas/types.yaml#/definitions/string + description: Identifying name. + + trigger-value: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Value to put in the Trigger register to activate this trigger + + trigger-external: + $ref: /schemas/types.yaml#/definitions/flag + description: This trigger is provided from an external pin. + + additionalProperties: false + required: + - trigger-name + - trigger-value + +examples: + - | + #include + #include + soc { + #address-cells = <1>; + #size-cells = <1>; + + adc@fffb0000 { + compatible = "atmel,at91sam9260-adc"; + reg = <0xfffb0000 0x100>; + interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&adc_clk>, <&adc_op_clk>; + clock-names = "adc_clk", "adc_op_clk"; + atmel,adc-channels-used = <0xff>; + atmel,adc-startup-time = <40>; + atmel,adc-use-external-triggers; + atmel,adc-vref = <3300>; + atmel,adc-use-res = "lowres"; + + trigger0 { + trigger-name = "external-rising"; + trigger-value = <0x1>; + trigger-external; + }; + + trigger1 { + trigger-name = "external-falling"; + trigger-value = <0x2>; + trigger-external; + }; + + trigger2 { + trigger-name = "external-any"; + trigger-value = <0x3>; + trigger-external; + }; + + trigger3 { + trigger-name = "continuous"; + trigger-value = <0x6>; + }; + }; + }; +... From patchwork Sat Nov 28 22:28:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B288C63798 for ; Sat, 28 Nov 2020 22:31:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F64A21D40 for ; Sat, 28 Nov 2020 22:31:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j2hP5wUF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F64A21D40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YNBsaTtx6IE+4Yyimp78Ntzdufx+UOa5mNJ2omPHRSw=; b=j2hP5wUFLZuTXkxfm1n6mYMCg 0dRTRANRh0WCjSnrJ0IReMJsxoQYq6Lw4kl4IyQvrYo8eHYgUuxapbK8I58pLFuvnkHwANY9EHCe0 NXY7jNqBxWxpYXnslROYiMXd7lJjgIBLJ+/py3F+rI9ki1BPWUBfYA0YeN1kk/6GP24gRms2g5LbO kcCFvNTYJ7472ZMQct6vMdbrYsdlG7bN6gSzQNOMEaneJQzsYQCksGF5FwUVMzeLcxT8wueDUjsld QxDSc/9KSixlINomZ8gyc5c1cw+hecW7CofGt1iOIcZFixOtd4T1YBa1JHZiMvRF9ZoqzYsodx/Pf YNfdTrulQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8iS-0008DE-NN; Sat, 28 Nov 2020 22:29:16 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hr-00080q-Ai for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:43 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id BEFF4FF805; Sat, 28 Nov 2020 22:28:33 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 05/10] iio: adc: at91_adc: rework trigger definition Date: Sat, 28 Nov 2020 23:28:13 +0100 Message-Id: <20201128222818.1910764-6-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172839_894230_A1402EB1 X-CRM114-Status: GOOD ( 20.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the available trigger definition back in the driver to stop cluttering the device tree. There is no functional change except that it actually fixes the available triggers for at91sam9rl as it inherited the list from at91sam9260 but actually has the triggers from at91sam9x5. Signed-off-by: Alexandre Belloni Reviewed-by: Ludovic Desroches --- drivers/iio/adc/at91_adc.c | 80 +++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 171288a4ab9a..d746a18143cd 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -207,6 +207,8 @@ struct at91_adc_caps { u8 low_res_bits; u8 high_res_bits; + u32 trigger_number; + const struct at91_adc_trigger *triggers; struct at91_adc_reg_desc registers; }; @@ -227,8 +229,6 @@ struct at91_adc_state { u8 sample_hold_time; bool sleep_mode; struct iio_trigger **trig; - struct at91_adc_trigger *trigger_list; - u32 trigger_number; bool use_external; u32 vref_mv; u32 res; /* resolution used for convertions */ @@ -537,13 +537,13 @@ static int at91_adc_channel_init(struct iio_dev *idev) } static int at91_adc_get_trigger_value_by_name(struct iio_dev *idev, - struct at91_adc_trigger *triggers, + const struct at91_adc_trigger *triggers, const char *trigger_name) { struct at91_adc_state *st = iio_priv(idev); int i; - for (i = 0; i < st->trigger_number; i++) { + for (i = 0; i < st->caps->trigger_number; i++) { char *name = kasprintf(GFP_KERNEL, "%s-dev%d-%s", idev->name, @@ -575,7 +575,7 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) u8 bit; value = at91_adc_get_trigger_value_by_name(idev, - st->trigger_list, + st->caps->triggers, idev->trig->name); if (value < 0) return value; @@ -620,7 +620,7 @@ static const struct iio_trigger_ops at91_adc_trigger_ops = { }; static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *idev, - struct at91_adc_trigger *trigger) + const struct at91_adc_trigger *trigger) { struct iio_trigger *trig; int ret; @@ -647,7 +647,7 @@ static int at91_adc_trigger_init(struct iio_dev *idev) int i, ret; st->trig = devm_kcalloc(&idev->dev, - st->trigger_number, sizeof(*st->trig), + st->caps->trigger_number, sizeof(*st->trig), GFP_KERNEL); if (st->trig == NULL) { @@ -655,12 +655,12 @@ static int at91_adc_trigger_init(struct iio_dev *idev) goto error_ret; } - for (i = 0; i < st->trigger_number; i++) { - if (st->trigger_list[i].is_external && !(st->use_external)) + for (i = 0; i < st->caps->trigger_number; i++) { + if (st->caps->triggers[i].is_external && !(st->use_external)) continue; st->trig[i] = at91_adc_allocate_trigger(idev, - st->trigger_list + i); + st->caps->triggers + i); if (st->trig[i] == NULL) { dev_err(&idev->dev, "Could not allocate trigger %d\n", i); @@ -685,7 +685,7 @@ static void at91_adc_trigger_remove(struct iio_dev *idev) struct at91_adc_state *st = iio_priv(idev); int i; - for (i = 0; i < st->trigger_number; i++) { + for (i = 0; i < st->caps->trigger_number; i++) { iio_trigger_unregister(st->trig[i]); iio_trigger_free(st->trig[i]); } @@ -836,8 +836,7 @@ static int at91_adc_probe_dt(struct iio_dev *idev, { struct at91_adc_state *st = iio_priv(idev); struct device_node *node = pdev->dev.of_node; - struct device_node *trig_node; - int i = 0, ret; + int ret; u32 prop; char *s; @@ -882,37 +881,6 @@ static int at91_adc_probe_dt(struct iio_dev *idev, st->registers = &st->caps->registers; st->num_channels = st->caps->num_channels; - st->trigger_number = of_get_child_count(node); - st->trigger_list = devm_kcalloc(&idev->dev, - st->trigger_number, - sizeof(struct at91_adc_trigger), - GFP_KERNEL); - if (!st->trigger_list) { - dev_err(&idev->dev, "Could not allocate trigger list memory.\n"); - ret = -ENOMEM; - goto error_ret; - } - - for_each_child_of_node(node, trig_node) { - struct at91_adc_trigger *trig = st->trigger_list + i; - const char *name; - - if (of_property_read_string(trig_node, "trigger-name", &name)) { - dev_err(&idev->dev, "Missing trigger-name property in the DT.\n"); - ret = -EINVAL; - goto error_ret; - } - trig->name = name; - - if (of_property_read_u32(trig_node, "trigger-value", &prop)) { - dev_err(&idev->dev, "Missing trigger-value property in the DT.\n"); - ret = -EINVAL; - goto error_ret; - } - trig->value = prop; - trig->is_external = of_property_read_bool(trig_node, "trigger-external"); - i++; - } /* Check if touchscreen is supported. */ if (st->caps->has_ts) @@ -1312,6 +1280,13 @@ static int at91_adc_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, at91_adc_resume); +static const struct at91_adc_trigger at91sam9260_triggers[] = { + { .name = "timer-counter-0", .value = 0x1 }, + { .name = "timer-counter-1", .value = 0x3 }, + { .name = "timer-counter-2", .value = 0x5 }, + { .name = "external", .value = 0xd, .is_external = true }, +}; + static struct at91_adc_caps at91sam9260_caps = { .calc_startup_ticks = calc_startup_ticks_9260, .num_channels = 4, @@ -1325,6 +1300,15 @@ static struct at91_adc_caps at91sam9260_caps = { .mr_prescal_mask = AT91_ADC_PRESCAL_9260, .mr_startup_mask = AT91_ADC_STARTUP_9260, }, + .triggers = at91sam9260_triggers, + .trigger_number = ARRAY_SIZE(at91sam9260_triggers), +}; + +static const struct at91_adc_trigger at91sam9x5_triggers[] = { + { .name = "external-rising", .value = 0x1, .is_external = true }, + { .name = "external-falling", .value = 0x2, .is_external = true }, + { .name = "external-any", .value = 0x3, .is_external = true }, + { .name = "continuous", .value = 0x6 }, }; static struct at91_adc_caps at91sam9rl_caps = { @@ -1341,6 +1325,8 @@ static struct at91_adc_caps at91sam9rl_caps = { .mr_prescal_mask = AT91_ADC_PRESCAL_9260, .mr_startup_mask = AT91_ADC_STARTUP_9G45, }, + .triggers = at91sam9x5_triggers, + .trigger_number = ARRAY_SIZE(at91sam9x5_triggers), }; static struct at91_adc_caps at91sam9g45_caps = { @@ -1357,6 +1343,8 @@ static struct at91_adc_caps at91sam9g45_caps = { .mr_prescal_mask = AT91_ADC_PRESCAL_9G45, .mr_startup_mask = AT91_ADC_STARTUP_9G45, }, + .triggers = at91sam9x5_triggers, + .trigger_number = ARRAY_SIZE(at91sam9x5_triggers), }; static struct at91_adc_caps at91sam9x5_caps = { @@ -1377,6 +1365,8 @@ static struct at91_adc_caps at91sam9x5_caps = { .mr_prescal_mask = AT91_ADC_PRESCAL_9G45, .mr_startup_mask = AT91_ADC_STARTUP_9X5, }, + .triggers = at91sam9x5_triggers, + .trigger_number = ARRAY_SIZE(at91sam9x5_triggers), }; static struct at91_adc_caps sama5d3_caps = { @@ -1396,6 +1386,8 @@ static struct at91_adc_caps sama5d3_caps = { .mr_prescal_mask = AT91_ADC_PRESCAL_9G45, .mr_startup_mask = AT91_ADC_STARTUP_9X5, }, + .triggers = at91sam9x5_triggers, + .trigger_number = ARRAY_SIZE(at91sam9x5_triggers), }; static const struct of_device_id at91_adc_dt_ids[] = { From patchwork Sat Nov 28 22:28:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85CB1C64E7B for ; Sat, 28 Nov 2020 22:31:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E35321D40 for ; Sat, 28 Nov 2020 22:31:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kUfIbLQ4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E35321D40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nsXcXQGVUUEdRnSEfRKN/ppIlO+/pD3ZrjwVp7PoJeI=; b=kUfIbLQ4KqgAz1JzMtlB72Cle iu6SY9s4/h6GnbK9Apzq3Gg207nN2JGfLqEUvt2wp57aDRFfRUt7iY3TZaSXGTw7xK7svN28ihKUk 8i86atjVx0NxBDgn5LspNmutJP9DizddfrWIiK1LUncRRLVUve7AzwgVqiLsIIc7KVyhaDtwcmjnT uGwWi8akQx9dz6sGLNEQyKhWyw6KJQ4bpBlSZvZg8DYcOubJ7pJch4G2pAd+txnt1p9As9GCNfiTI F8EjyHZ/9G/deeoFsM8bfM0hN0XXRQRIWMAP1kCGLpRZP+E1Pagtjn+B2TI6f1X+/NxWAZKdxUEjs dkBuvkKyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8ig-0008Hy-0f; Sat, 28 Nov 2020 22:29:30 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hp-000811-H5 for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:39 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 008521BF204; Sat, 28 Nov 2020 22:28:35 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 06/10] dt-bindings:iio:adc:remove triggers Date: Sat, 28 Nov 2020 23:28:14 +0100 Message-Id: <20201128222818.1910764-7-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172837_835760_9FBEB7E7 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Rob Herring , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The trigger child nodes are not necessary anymore as they are defined directly by the driver, depending on the compatible string. Cc: Rob Herring Signed-off-by: Alexandre Belloni --- .../bindings/iio/adc/atmel,sama9260-adc.yaml | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml b/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml index 9b0ff59e75de..e6a1f915b542 100644 --- a/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml @@ -97,29 +97,6 @@ required: - atmel,adc-startup-time - atmel,adc-vref -patternProperties: - "^(trigger)[0-9]$": - type: object - description: Child node to describe a trigger exposed to the user. - properties: - trigger-name: - $ref: /schemas/types.yaml#/definitions/string - description: Identifying name. - - trigger-value: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Value to put in the Trigger register to activate this trigger - - trigger-external: - $ref: /schemas/types.yaml#/definitions/flag - description: This trigger is provided from an external pin. - - additionalProperties: false - required: - - trigger-name - - trigger-value - examples: - | #include @@ -139,29 +116,6 @@ examples: atmel,adc-use-external-triggers; atmel,adc-vref = <3300>; atmel,adc-use-res = "lowres"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; }; }; ... From patchwork Sat Nov 28 22:28:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E719CC63798 for ; Sat, 28 Nov 2020 22:30:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 569A321D40 for ; Sat, 28 Nov 2020 22:30:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sGVjwQsE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 569A321D40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Au14mep7m38cOep9uO7/TGi3dZfbAbTd7mYVBx1nl5k=; b=sGVjwQsE6FMztKRzWPCRPMY6m tLzVbtOUe6ZjpXWs65LBI1tsyFtQQXJKjs8yJsKaSXMdX86MrJnEfom39duQL0XTF/HBW+kF/KRmj oIvGmeGvFFZNzBruv5qKHVKhk3t2yn6X65O0yPPzkOXnaE3W+HUWFCiS+pNUG1y4EbyXqmaCZl3Ms RJyFnHopZ6lwwkM7fRf99Z8R++4wrZHcdne9AMGIX1um93XEBFSJeky8dFdY0PEccUNl9zsbZKEJu YQG0YJtbkSe0iXa2c+9xwxLBeeHNJA2ne6UQUXsjD2tB13L3pQ65/5NyaDWzAOSE/F4/yJleI/JvM dPiI6i+Pw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8iP-0008By-8a; Sat, 28 Nov 2020 22:29:13 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hq-00081G-Bs for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:41 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D6AA1C0004; Sat, 28 Nov 2020 22:28:36 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 07/10] iio: adc: at91_adc: merge at91_adc_probe_dt back in at91_adc_probe Date: Sat, 28 Nov 2020 23:28:15 +0100 Message-Id: <20201128222818.1910764-8-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172838_995239_AE77D461 X-CRM114-Status: GOOD ( 15.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org at91_adc_probe_dt is now small enough to be merged back in at91_adc_probe. Signed-off-by: Alexandre Belloni Reviewed-by: Ludovic Desroches --- drivers/iio/adc/at91_adc.c | 115 ++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 67 deletions(-) diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index d746a18143cd..70750abb5dea 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -831,69 +831,6 @@ static int at91_adc_probe_dt_ts(struct device_node *node, } } -static int at91_adc_probe_dt(struct iio_dev *idev, - struct platform_device *pdev) -{ - struct at91_adc_state *st = iio_priv(idev); - struct device_node *node = pdev->dev.of_node; - int ret; - u32 prop; - char *s; - - st->caps = of_device_get_match_data(&pdev->dev); - - st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers"); - - if (of_property_read_u32(node, "atmel,adc-channels-used", &prop)) { - dev_err(&idev->dev, "Missing adc-channels-used property in the DT.\n"); - ret = -EINVAL; - goto error_ret; - } - st->channels_mask = prop; - - st->sleep_mode = of_property_read_bool(node, "atmel,adc-sleep-mode"); - - if (of_property_read_u32(node, "atmel,adc-startup-time", &prop)) { - dev_err(&idev->dev, "Missing adc-startup-time property in the DT.\n"); - ret = -EINVAL; - goto error_ret; - } - st->startup_time = prop; - - prop = 0; - of_property_read_u32(node, "atmel,adc-sample-hold-time", &prop); - st->sample_hold_time = prop; - - if (of_property_read_u32(node, "atmel,adc-vref", &prop)) { - dev_err(&idev->dev, "Missing adc-vref property in the DT.\n"); - ret = -EINVAL; - goto error_ret; - } - st->vref_mv = prop; - - st->res = st->caps->high_res_bits; - if (st->caps->low_res_bits && - !of_property_read_string(node, "atmel,adc-use-res", (const char **)&s) - && !strcmp(s, "lowres")) - st->res = st->caps->low_res_bits; - - dev_info(&idev->dev, "Resolution used: %u bits\n", st->res); - - st->registers = &st->caps->registers; - st->num_channels = st->caps->num_channels; - - /* Check if touchscreen is supported. */ - if (st->caps->has_ts) - return at91_adc_probe_dt_ts(node, st, &idev->dev); - else - dev_info(&idev->dev, "not support touchscreen in the adc compatible string.\n"); - - return 0; - -error_ret: - return ret; -} - static const struct iio_info at91_adc_info = { .read_raw = &at91_adc_read_raw, }; @@ -1059,10 +996,12 @@ static void at91_ts_unregister(struct at91_adc_state *st) static int at91_adc_probe(struct platform_device *pdev) { unsigned int prsc, mstrclk, ticks, adc_clk, adc_clk_khz, shtim; + struct device_node *node = pdev->dev.of_node; int ret; struct iio_dev *idev; struct at91_adc_state *st; - u32 reg; + u32 reg, prop; + char *s; idev = devm_iio_device_alloc(&pdev->dev, sizeof(struct at91_adc_state)); if (!idev) @@ -1070,9 +1009,51 @@ static int at91_adc_probe(struct platform_device *pdev) st = iio_priv(idev); - ret = at91_adc_probe_dt(idev, pdev); - if (ret) - return ret; + st->caps = of_device_get_match_data(&pdev->dev); + + st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers"); + + if (of_property_read_u32(node, "atmel,adc-channels-used", &prop)) { + dev_err(&idev->dev, "Missing adc-channels-used property in the DT.\n"); + return -EINVAL; + } + st->channels_mask = prop; + + st->sleep_mode = of_property_read_bool(node, "atmel,adc-sleep-mode"); + + if (of_property_read_u32(node, "atmel,adc-startup-time", &prop)) { + dev_err(&idev->dev, "Missing adc-startup-time property in the DT.\n"); + return -EINVAL; + } + st->startup_time = prop; + + prop = 0; + of_property_read_u32(node, "atmel,adc-sample-hold-time", &prop); + st->sample_hold_time = prop; + + if (of_property_read_u32(node, "atmel,adc-vref", &prop)) { + dev_err(&idev->dev, "Missing adc-vref property in the DT.\n"); + return -EINVAL; + } + st->vref_mv = prop; + + st->res = st->caps->high_res_bits; + if (st->caps->low_res_bits && + !of_property_read_string(node, "atmel,adc-use-res", (const char **)&s) + && !strcmp(s, "lowres")) + st->res = st->caps->low_res_bits; + + dev_info(&idev->dev, "Resolution used: %u bits\n", st->res); + + st->registers = &st->caps->registers; + st->num_channels = st->caps->num_channels; + + /* Check if touchscreen is supported. */ + if (st->caps->has_ts) { + ret = at91_adc_probe_dt_ts(node, st, &idev->dev); + if (ret) + return ret; + } platform_set_drvdata(pdev, idev); From patchwork Sat Nov 28 22:28:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3656C63777 for ; Sat, 28 Nov 2020 22:31:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E18520578 for ; Sat, 28 Nov 2020 22:31:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wqySKz43" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E18520578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V6SML3ttdm3PcZM7XgxfhThAJTQdWS60siNeqV7pRRU=; b=wqySKz43XMuinpk71V4aKMiiA 7KCSEIBk4YJeyaLN3AYv7K4WZQGBPgyQHMxWLFmLwAnw9WJo5OAbe5H0jsk3Uow/gXV7AfitbFQRv INZz7dRji2KByEQkcqBbOg+tDkbncZZM2G05Zle2UygGHf9szDIM4E8vbz0EiOjV1DAR9a1g4oza4 yXD3CdpkPd42PjMzGiu4yGsg5+6d8XX20zCBU7z0W2KC/u7BxFGdiF/LMgXWK+8Mnbg0XHMbiAU+F s6ps/FBA/HXAGsquI5HY7SeIcjgJB6niCB1BDQ3/ooOcn30lOy0YQ9uDCB7NV5qkftPoj2BqLv8KV bLNuv/Tkw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8iy-0008Om-NZ; Sat, 28 Nov 2020 22:29:49 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8hu-00082h-2f for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:46 +0000 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 0DD1F100002; Sat, 28 Nov 2020 22:28:37 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 08/10] ARM: dts: at91: sama5d3: use proper ADC compatible Date: Sat, 28 Nov 2020 23:28:16 +0100 Message-Id: <20201128222818.1910764-9-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172842_734029_E64E2AFE X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The ADC is different from the at91sam9x5 ADC. Not only it doesn't have the same resolution but it even have only one and the LOWRES bit doesn't exist. Signed-off-by: Alexandre Belloni Reviewed-by: Ludovic Desroches --- arch/arm/boot/dts/sama5d3.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index 0bb5b6fa0748..9a0c94492c5b 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi @@ -304,7 +304,7 @@ ssc1: ssc@f800c000 { adc0: adc@f8018000 { #address-cells = <1>; #size-cells = <0>; - compatible = "atmel,at91sam9x5-adc"; + compatible = "atmel,sama5d3-adc"; reg = <0xf8018000 0x100>; interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; From patchwork Sat Nov 28 22:28:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 822D7C63798 for ; Sat, 28 Nov 2020 22:31:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B289221FD for ; Sat, 28 Nov 2020 22:31:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pDuSEWWX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B289221FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BBOkji4M70LBKh1AGvCEG3XVlqlg6CKjDY8GkRKQOIY=; b=pDuSEWWXY+isUILhAwAduJjPY ZsvGnnd2++q6EAk77nsa2tS0DjfuOR/faKHmNu9mlSo10LulHuXewKzY1NpdqegyEwyZok9TVaVzi 0NWEbf9vW1Ue1NSogIQEx3bYWw/On0OL3NzTNbGSG3MTf7fStaio8a2eRKPlf4yYgFOSRydOqygJ2 u+07fZAe9YdyN1cOM6UjZ+PrF/bOFspUd/upO9rDzcMGefNj7ZXv8SM+cybeZgTO80p4r8KgKISQI lNmtFL84b4fEvYFEgQLy9ZEy4iRSQu7Ilh5uvK3dnO5kPjBXbl87ok3srHYpPBg6c3v4URmAlTM9q p1kxeEm4g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8iq-0008Lj-35; Sat, 28 Nov 2020 22:29:40 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8ht-00082Y-0Z for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:46 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 81A76FF807; Sat, 28 Nov 2020 22:28:39 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 09/10] ARM: dts: at91: at91sam9rl: fix ADC triggers Date: Sat, 28 Nov 2020 23:28:17 +0100 Message-Id: <20201128222818.1910764-10-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172842_735876_3B4A66B8 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The triggers for the ADC were taken from at91sam9260 dtsi but are not correct. Fixes: a4c1d6c75822 ("ARM: at91/dt: sam9rl: add lcd, adc, usb gadget and pwm support") Signed-off-by: Alexandre Belloni --- arch/arm/boot/dts/at91sam9rl.dtsi | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi index 4d70194fd808..bf85a9419c69 100644 --- a/arch/arm/boot/dts/at91sam9rl.dtsi +++ b/arch/arm/boot/dts/at91sam9rl.dtsi @@ -278,23 +278,26 @@ adc0: adc@fffd0000 { atmel,adc-use-res = "highres"; trigger0 { - trigger-name = "timer-counter-0"; + trigger-name = "external-rising"; trigger-value = <0x1>; + trigger-external; }; + trigger1 { - trigger-name = "timer-counter-1"; - trigger-value = <0x3>; + trigger-name = "external-falling"; + trigger-value = <0x2>; + trigger-external; }; trigger2 { - trigger-name = "timer-counter-2"; - trigger-value = <0x5>; + trigger-name = "external-any"; + trigger-value = <0x3>; + trigger-external; }; trigger3 { - trigger-name = "external"; - trigger-value = <0x13>; - trigger-external; + trigger-name = "continuous"; + trigger-value = <0x6>; }; }; From patchwork Sat Nov 28 22:28:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11938713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49D18C64E7B for ; Sat, 28 Nov 2020 22:31:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02DD120578 for ; Sat, 28 Nov 2020 22:31:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fhvv98iu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02DD120578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=npYqzGCwfMESEuI7sAchM8zllw8srljOGdBXSf761ZU=; b=fhvv98iueMdLd5JO5wUuZffCk 5m27oaKNve9piJGAh5+2ZGyCcfHJzNNsx/UjEQ7XEczi3WkXqB3SvPzOSEBlmxhbQPos68bw+Zp8G 4Fxrd+j9LiaycbsV+4cDb93PHhy27RSY1/aCAKeWN0pHUp4vTuQzheLHZvnbgFQgc4F2bSySFdUFm iDPj+iogg2/fiD2nQDGnAuXVwa+s8PSl+HIGXV1Ccg5ObXH3313P6+DuhoHWuaPNMoEgG/Fb3zI3B HZw3mxGFfgafzrfr+JtG3UhElxJPFYwL5GBAPOPQxqWVXcGz8Y68Ja1bf7HoCZ59ntHdQIK93XWzK eeyJLZ4pA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8jJ-0008Vr-L1; Sat, 28 Nov 2020 22:30:09 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj8ht-00082p-Td for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 22:28:47 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 565ED1BF205; Sat, 28 Nov 2020 22:28:40 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH v3 10/10] ARM: dts: at91: remove deprecated ADC properties Date: Sat, 28 Nov 2020 23:28:18 +0100 Message-Id: <20201128222818.1910764-11-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> References: <20201128222818.1910764-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_172842_766890_BA1C74BE X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org atmel,adc-res, atmel,adc-res-names and the trigger nodes are not parsed by the driver anymore and the information is now defined in the driver data. Also remove the leftover #address-cells and #size-cells that were used when the trigger nodes had a unit-address. Finally, the default is already to use the highest resoution. Remove atmel,adc-use-res from the SoC dtsi. Signed-off-by: Alexandre Belloni Reviewed-by: Ludovic Desroches --- arch/arm/boot/dts/at91sam9260.dtsi | 25 ------------------------- arch/arm/boot/dts/at91sam9g45.dtsi | 27 --------------------------- arch/arm/boot/dts/at91sam9rl.dtsi | 28 ---------------------------- arch/arm/boot/dts/at91sam9x5.dtsi | 28 ---------------------------- arch/arm/boot/dts/sama5d3.dtsi | 24 ------------------------ arch/arm/boot/dts/sama5d4.dtsi | 22 ---------------------- 6 files changed, 154 deletions(-) diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index 6afbb48e7ff0..1fc76ebef46e 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi @@ -694,8 +694,6 @@ spi1: spi@fffcc000 { }; adc0: adc@fffe0000 { - #address-cells = <1>; - #size-cells = <0>; compatible = "atmel,at91sam9260-adc"; reg = <0xfffe0000 0x100>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>; @@ -705,29 +703,6 @@ adc0: adc@fffe0000 { atmel,adc-channels-used = <0xf>; atmel,adc-vref = <3300>; atmel,adc-startup-time = <15>; - atmel,adc-res = <8 10>; - atmel,adc-res-names = "lowres", "highres"; - atmel,adc-use-res = "highres"; - - trigger0 { - trigger-name = "timer-counter-0"; - trigger-value = <0x1>; - }; - trigger1 { - trigger-name = "timer-counter-1"; - trigger-value = <0x3>; - }; - - trigger2 { - trigger-name = "timer-counter-2"; - trigger-value = <0x5>; - }; - - trigger3 { - trigger-name = "external"; - trigger-value = <0xd>; - trigger-external; - }; }; rtc@fffffd20 { diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi index 1fbee2a7785f..ec71c316962c 100644 --- a/arch/arm/boot/dts/at91sam9g45.dtsi +++ b/arch/arm/boot/dts/at91sam9g45.dtsi @@ -808,8 +808,6 @@ ac97: sound@fffac000 { }; adc0: adc@fffb0000 { - #address-cells = <1>; - #size-cells = <0>; compatible = "atmel,at91sam9g45-adc"; reg = <0xfffb0000 0x100>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; @@ -818,31 +816,6 @@ adc0: adc@fffb0000 { atmel,adc-channels-used = <0xff>; atmel,adc-vref = <3300>; atmel,adc-startup-time = <40>; - atmel,adc-res = <8 10>; - atmel,adc-res-names = "lowres", "highres"; - atmel,adc-use-res = "highres"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; }; isi@fffb4000 { diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi index bf85a9419c69..6139e0fd613f 100644 --- a/arch/arm/boot/dts/at91sam9rl.dtsi +++ b/arch/arm/boot/dts/at91sam9rl.dtsi @@ -262,8 +262,6 @@ spi0: spi@fffcc000 { }; adc0: adc@fffd0000 { - #address-cells = <1>; - #size-cells = <0>; compatible = "atmel,at91sam9rl-adc"; reg = <0xfffd0000 0x100>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; @@ -273,32 +271,6 @@ adc0: adc@fffd0000 { atmel,adc-channels-used = <0x3f>; atmel,adc-vref = <3300>; atmel,adc-startup-time = <40>; - atmel,adc-res = <8 10>; - atmel,adc-res-names = "lowres", "highres"; - atmel,adc-use-res = "highres"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; }; usb0: gadget@fffd4000 { diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index 948fe99ab6c3..4fa75e5a4029 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi @@ -793,8 +793,6 @@ uart1: serial@f8044000 { }; adc0: adc@f804c000 { - #address-cells = <1>; - #size-cells = <0>; compatible = "atmel,at91sam9x5-adc"; reg = <0xf804c000 0x100>; interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>; @@ -806,32 +804,6 @@ adc0: adc@f804c000 { atmel,adc-vref = <3300>; atmel,adc-startup-time = <40>; atmel,adc-sample-hold-time = <11>; - atmel,adc-res = <8 10>; - atmel,adc-res-names = "lowres", "highres"; - atmel,adc-use-res = "highres"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; }; spi0: spi@f0000000 { diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index 9a0c94492c5b..40bb576d1636 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi @@ -302,8 +302,6 @@ ssc1: ssc@f800c000 { }; adc0: adc@f8018000 { - #address-cells = <1>; - #size-cells = <0>; compatible = "atmel,sama5d3-adc"; reg = <0xf8018000 0x100>; interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>; @@ -330,30 +328,8 @@ &pinctrl_adc0_ad11 atmel,adc-startup-time = <40>; atmel,adc-use-external-triggers; atmel,adc-vref = <3000>; - atmel,adc-res = <10 12>; atmel,adc-sample-hold-time = <11>; - atmel,adc-res-names = "lowres", "highres"; status = "disabled"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; }; i2c2: i2c@f801c000 { diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 2d9f853ab15f..68d83027e7ab 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi @@ -655,31 +655,9 @@ adc0: adc@fc034000 { atmel,adc-startup-time = <40>; atmel,adc-use-external-triggers; atmel,adc-vref = <3000>; - atmel,adc-res = <8 10>; atmel,adc-sample-hold-time = <11>; - atmel,adc-res-names = "lowres", "highres"; atmel,adc-ts-pressure-threshold = <10000>; status = "disabled"; - - trigger0 { - trigger-name = "external-rising"; - trigger-value = <0x1>; - trigger-external; - }; - trigger1 { - trigger-name = "external-falling"; - trigger-value = <0x2>; - trigger-external; - }; - trigger2 { - trigger-name = "external-any"; - trigger-value = <0x3>; - trigger-external; - }; - trigger3 { - trigger-name = "continuous"; - trigger-value = <0x6>; - }; }; aes@fc044000 {