From patchwork Wed Nov 30 18:26:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13060229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C81C9C4708A for ; Wed, 30 Nov 2022 18:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbiK3S0l (ORCPT ); Wed, 30 Nov 2022 13:26:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbiK3S0j (ORCPT ); Wed, 30 Nov 2022 13:26:39 -0500 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A0C31AF21; Wed, 30 Nov 2022 10:26:38 -0800 (PST) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1432a5f6468so22017549fac.12; Wed, 30 Nov 2022 10:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SWx0R0ogEqD2NvSzMhQm7EDv0VkYaoaO8e5x2Y51N/Y=; b=Q7363XeANv4JltXcUpQKqXZkb7TKRhyadCkPlMQda1dioPKCQte9UDP1vVoZx/HLcO 27FnjGis4UqoHE32rmo2X9JD4ZutUS6PExxuL64I7jhRXylD3Gpla/7K+kCsB+29lfCM 4hfInWFNduB/s0bY96Fmhzbfo8yj2ctzO3L1yfLj8YA/NN0Z9plivJk3Okmn1bfg26Zg 7FMaD1iCiUIoaAHmbS/Q1vss/JxtaIcs8lHa977Bx/+IhG6//UAgFd73M/nsP00ejj89 nI/QbpS3XA7UBMAHgPFBqoEk02iDXeeX5jqfGBW8RmZypMoG+vZrOQsDw+djSiHlxjl6 OqLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SWx0R0ogEqD2NvSzMhQm7EDv0VkYaoaO8e5x2Y51N/Y=; b=JzSRFrZJPsK2ZcExInkMJWtFr2irwtQ7CO6+iqOqs/MH/xjXRAWMPQzLxzTm1jKm/8 /2CwD/OmrQJ1MX3sEo95qTb3Yi3Pgdg+MWGO5WWRts4/J34Uxcx3tysPUXeNCtPfH0xb n8VOS8jcfImQebsnVxEFWvJ9c+J+4mEWIrQuiRA8bkJrC2+mTG+T5lBvFID1LmnzvscM 8EbLqotMHfycupaIJ7ns/wYgyenvy+K3s+kD4DeGwArscnmGbXA6PmszFh4qkjcnb10p 93/KKc0zBTMTRQFgdhIOjYDfzXEjXXocrVX/NAzhI+S/qlWAuRB81P6Q/fzFoCAa5T61 OgBQ== X-Gm-Message-State: ANoB5plwgqWQQzl3U3tGKgbZD5ZOMkUkQtdjhy/xJ8fMZxTbe+ib2gAE 6EdQ5OVsywS0n8JdYLGAU7FFK65uv/I= X-Google-Smtp-Source: AA0mqf6bt9cRY4yr7kZk+kFGWJ9U55vPUoCPrdVOD3GrugU2ZQlCnrAlMEBZjfLAvzMYZ4X3f7TiRw== X-Received: by 2002:a05:6870:c352:b0:13b:66b0:3ef3 with SMTP id e18-20020a056870c35200b0013b66b03ef3mr26501510oak.210.1669832797652; Wed, 30 Nov 2022 10:26:37 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:4b69:e48f:7d21:8a92:6dc]) by smtp.gmail.com with ESMTPSA id m24-20020a0568301e7800b006690f65a830sm1209972otr.14.2022.11.30.10.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 10:26:37 -0800 (PST) From: Fabio Estevam To: jic23@kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/2] dt-bindings: iio: dac: ad5686: Add an entry for AD5337 Date: Wed, 30 Nov 2022 15:26:31 -0300 Message-Id: <20221130182632.3856675-1-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org AD5337 belongs to the same family as the AD5338. The difference is that the AD5337 has 8-bit resolution instead of 10-bit. Add a compatible entry for AD5337. Signed-off-by: Fabio Estevam Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml index 13f214234b8e..b4400c52bec3 100644 --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml @@ -33,6 +33,7 @@ properties: - description: I2C devices enum: - adi,ad5311r + - adi,ad5337r - adi,ad5338r - adi,ad5671r - adi,ad5675r From patchwork Wed Nov 30 18:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13060230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B745C433FE for ; Wed, 30 Nov 2022 18:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbiK3S0o (ORCPT ); Wed, 30 Nov 2022 13:26:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiK3S0m (ORCPT ); Wed, 30 Nov 2022 13:26:42 -0500 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3565213E16; Wed, 30 Nov 2022 10:26:40 -0800 (PST) Received: by mail-oi1-x234.google.com with SMTP id t62so19646203oib.12; Wed, 30 Nov 2022 10:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RGjOYqsJ4mpJB2xZwE/rziR8NLFmClSXUULTYa2k8yU=; b=oQLpUJp5d/SDEQkPeAmaK3imrtzhoV7AJV8DnSFQ15Ps/WGI8Wnq3bxng6w1oXf52B Ze1JTPcyxDqFZwAXPMakP0AN8lf678/PLNK3VCqQCni951cB1NjleZw2ET55E76vu93Z q2Wa71GQ2mGHUybOkQyFC3r/j+RoK5qE1xNKydQiUUJiFeu9od+mT+6UQJohzJrc/mXb BcwjeaKACY5COJmH05uZa4kwltfedmMO+wttfFM54/82AeB30w2DTCsr0W4szaKKXtGE WgP6KjhRAme2ereRGa9bLv0388fkuEnXu83fAR33b5gamiiyQZByunfEi6Mi3DYDGV0w NXaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RGjOYqsJ4mpJB2xZwE/rziR8NLFmClSXUULTYa2k8yU=; b=4hrn7RF8v2MzUAzG/kV8XvEE0ffYfgpGDCwsbjCX62APwr3VjrQpG8CtCkcLCNSql6 rmgyzMIWuea27YxdRoRm2Ttd723T5nEFkrqBwKO6A14fVVM76VQYXjZJ5j8q16OvxgVI HYnlsA0juv6yT0sQ4nGz+t31QO0/IcBRvCh1ZJ0X+o6itkh/6YyqCtgRlVAE6fgXEplv 4hZqq61YlbuY3JYz2pHqWJNNy0CaX3Uit/B+NQf138orUihDOZmZQIPtWmq7AbqQYG2f AKrxjeDm/LxxY+QppYj5gj/ekZyFBYhOnlEyHneJgIaaR99jHyU9XH2eUE8bD8NjeFod HXow== X-Gm-Message-State: ANoB5pnnoFDJpJwvB6GoqtZcUrNAbNAj7Bj0arO0gsNAMO7OvVAN5IM0 ZXNaJ4EXP9dbbFR31xqHatM= X-Google-Smtp-Source: AA0mqf77snlArXHG8vx98XRaqgtiE/ggXGaDKOCcwT+WvqNStpwv2sxoJQE9dFHM5u3r3Hdkt6Nqng== X-Received: by 2002:a05:6808:46:b0:35a:ff1:bf0d with SMTP id v6-20020a056808004600b0035a0ff1bf0dmr22742161oic.115.1669832800241; Wed, 30 Nov 2022 10:26:40 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:4b69:e48f:7d21:8a92:6dc]) by smtp.gmail.com with ESMTPSA id m24-20020a0568301e7800b006690f65a830sm1209972otr.14.2022.11.30.10.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 10:26:39 -0800 (PST) From: Fabio Estevam To: jic23@kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/2] iio: dac: ad5686: Add support for AD5337 Date: Wed, 30 Nov 2022 15:26:32 -0300 Message-Id: <20221130182632.3856675-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221130182632.3856675-1-festevam@gmail.com> References: <20221130182632.3856675-1-festevam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org AD5337 belongs to the same family as the AD5338. The difference is that the AD5337 has 8-bit precision instead of 10-bit. Add support for the AD5337 chip in the driver. Signed-off-by: Fabio Estevam --- drivers/iio/dac/Kconfig | 8 ++++---- drivers/iio/dac/ad5686.c | 7 +++++++ drivers/iio/dac/ad5686.h | 1 + drivers/iio/dac/ad5696-i2c.c | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig index 80521bd28d0f..e83eb75d87d1 100644 --- a/drivers/iio/dac/Kconfig +++ b/drivers/iio/dac/Kconfig @@ -162,10 +162,10 @@ config AD5696_I2C depends on I2C select AD5686 help - Say yes here to build support for Analog Devices AD5311R, AD5338R, - AD5671R, AD5673R, AD5675R, AD5677R, AD5691R, AD5692R, AD5693, AD5693R, - AD5694, AD5694R, AD5695R, AD5696, and AD5696R Digital to Analog - converters. + Say yes here to build support for Analog Devices AD5311R, AD5337, + AD5338R, AD5671R, AD5673R, AD5675R, AD5677R, AD5691R, AD5692R, AD5693, + AD5693R, AD5694, AD5694R, AD5695R, AD5696, and AD5696R Digital to + Analog converters. To compile this driver as a module, choose M here: the module will be called ad5696. diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c index 15361d8bbf94..57cc0f0eedc6 100644 --- a/drivers/iio/dac/ad5686.c +++ b/drivers/iio/dac/ad5686.c @@ -258,6 +258,7 @@ static const struct iio_chan_spec name[] = { \ DECLARE_AD5693_CHANNELS(ad5310r_channels, 10, 2); DECLARE_AD5693_CHANNELS(ad5311r_channels, 10, 6); +DECLARE_AD5338_CHANNELS(ad5337r_channels, 8, 8); DECLARE_AD5338_CHANNELS(ad5338r_channels, 10, 6); DECLARE_AD5676_CHANNELS(ad5672_channels, 12, 4); DECLARE_AD5679_CHANNELS(ad5674r_channels, 12, 4); @@ -283,6 +284,12 @@ static const struct ad5686_chip_info ad5686_chip_info_tbl[] = { .num_channels = 1, .regmap_type = AD5693_REGMAP, }, + [ID_AD5337R] = { + .channels = ad5337r_channels, + .int_vref_mv = 2500, + .num_channels = 2, + .regmap_type = AD5686_REGMAP, + }, [ID_AD5338R] = { .channels = ad5338r_channels, .int_vref_mv = 2500, diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h index b7ade3a6b9b6..760f852911df 100644 --- a/drivers/iio/dac/ad5686.h +++ b/drivers/iio/dac/ad5686.h @@ -54,6 +54,7 @@ enum ad5686_supported_device_ids { ID_AD5310R, ID_AD5311R, + ID_AD5337R, ID_AD5338R, ID_AD5671R, ID_AD5672R, diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c index 160e80cf9135..8a95f0278018 100644 --- a/drivers/iio/dac/ad5696-i2c.c +++ b/drivers/iio/dac/ad5696-i2c.c @@ -72,6 +72,7 @@ static void ad5686_i2c_remove(struct i2c_client *i2c) static const struct i2c_device_id ad5686_i2c_id[] = { {"ad5311r", ID_AD5311R}, + {"ad5337r", ID_AD5337R}, {"ad5338r", ID_AD5338R}, {"ad5671r", ID_AD5671R}, {"ad5673r", ID_AD5673R}, @@ -92,6 +93,7 @@ MODULE_DEVICE_TABLE(i2c, ad5686_i2c_id); static const struct of_device_id ad5686_of_match[] = { { .compatible = "adi,ad5311r" }, + { .compatible = "adi,ad5337r" }, { .compatible = "adi,ad5338r" }, { .compatible = "adi,ad5671r" }, { .compatible = "adi,ad5675r" },