From patchwork Fri Feb 18 04:20:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagath Jog J X-Patchwork-Id: 12750944 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 76C08C433F5 for ; Fri, 18 Feb 2022 04:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiBREVF (ORCPT ); Thu, 17 Feb 2022 23:21:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiBREVD (ORCPT ); Thu, 17 Feb 2022 23:21:03 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 934CE1AE2EA; Thu, 17 Feb 2022 20:20:46 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id r64-20020a17090a43c600b001b8854e682eso7440426pjg.0; Thu, 17 Feb 2022 20:20:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w9jy9lnBDfLmIqFJjt9CXkg0EOVyG3IWJdyZ7MDDT48=; b=UPCTlZ0swfrwbFLXVOya701Jv3B3HlhbJUKkpxB93yMY/H//u+pKHOLpW2I2K2WsM1 oIAVwWIi9TD5AStUBpZNUL2i7s7QAcQV75kfILaKo1uUKDegQonoPcGCnIUaq5PA5qZA RKXzmdn2nG3nwTRvkRrOUi5nT4p8BP78VYsrCtqB2y1aj4lDD4tUr4fkJPcEKGN2VPOo 32XZOuM5Slxs5ddGEfp22/ytOihp7E5HrFa/5CqKL9sJNv5rtNkwK/3IrG9pK9dOes43 BKKCpR9F/XhxQI9YXj6LhZxgjjhYo5JNSrOgVUrkzUPuRui7zMfon9fauX9MWP20ez/z +QzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w9jy9lnBDfLmIqFJjt9CXkg0EOVyG3IWJdyZ7MDDT48=; b=Kcj24vIO4eGIzrPmXMMxi/gghB7rE3ajeL6SbqJtjptDMda67vqLcI4VeLcRFvERHF RSfcudv0YQdMTA07NhhCTHJ3Io1+Jvj/pABsgykPSEgnj781iY+ZwaNJHwe5yMQdVS4x FgejCfLdLh7F4+wkkXntNL5PUqNjyoGXUYRXGzXLH+sRU22T6kQ0/w/q1iJOjnyK9g62 0i5MdUOiezIOeMo2MYSoxg5OZgZYgk7enRFu+6zXAuLTX3ipMOveEPsN/no6V+Kllm7m a+fYSVAobSh/paL3lk+F/XIk0aZQV+oxzllrhKAou2ACMEjq1jxYFob2/SrilWx9fEXO Ei5g== X-Gm-Message-State: AOAM532rjZmnN3Gn/tJoUIsQYtH5qf1KCvsCcziwBTsUrcW6LiMUxRSu 7YuEb3YqlJeyDizpHsusFTY= X-Google-Smtp-Source: ABdhPJx7par3ttPSlRlhWiG9GkZzNtHe8Ay6NFd7jXeJwRRjl3JBqPtPpyhQt7a2/ZmJxl7jJ5MiSg== X-Received: by 2002:a17:902:ac96:b0:14d:3633:b0ad with SMTP id h22-20020a170902ac9600b0014d3633b0admr5843721plr.32.1645158045991; Thu, 17 Feb 2022 20:20:45 -0800 (PST) Received: from localhost.localdomain ([60.243.248.66]) by smtp.gmail.com with ESMTPSA id h26sm9530300pgm.72.2022.02.17.20.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:20:45 -0800 (PST) From: Jagath Jog J To: jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com, sst@poczta.fm, robh+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/6] iio: potentiometer: Alignment to match the open parenthesis Date: Fri, 18 Feb 2022 09:50:33 +0530 Message-Id: <20220218042038.15176-2-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220218042038.15176-1-jagathjog1996@gmail.com> References: <20220218042038.15176-1-jagathjog1996@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Fix following checkpatch.pl check by removing blank space. CHECK: Alignment should match open parenthesis. Signed-off-by: Jagath Jog J --- drivers/iio/potentiometer/ds1803.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 20b45407eaac..3c542a50ece6 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -55,8 +55,8 @@ static const struct iio_chan_spec ds1803_channels[] = { }; static int ds1803_read_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int *val, int *val2, long mask) + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) { struct ds1803_data *data = iio_priv(indio_dev); int pot = chan->channel; @@ -66,7 +66,7 @@ static int ds1803_read_raw(struct iio_dev *indio_dev, switch (mask) { case IIO_CHAN_INFO_RAW: ret = i2c_master_recv(data->client, result, - indio_dev->num_channels); + indio_dev->num_channels); if (ret < 0) return ret; @@ -83,8 +83,8 @@ static int ds1803_read_raw(struct iio_dev *indio_dev, } static int ds1803_write_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int val, int val2, long mask) + struct iio_chan_spec const *chan, + int val, int val2, long mask) { struct ds1803_data *data = iio_priv(indio_dev); int pot = chan->channel; @@ -109,8 +109,7 @@ static const struct iio_info ds1803_info = { .write_raw = ds1803_write_raw, }; -static int ds1803_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ds1803_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device *dev = &client->dev; struct ds1803_data *data; From patchwork Fri Feb 18 04:20:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagath Jog J X-Patchwork-Id: 12750948 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 F3EFFC4332F for ; Fri, 18 Feb 2022 04:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiBREVK (ORCPT ); Thu, 17 Feb 2022 23:21:10 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbiBREVH (ORCPT ); Thu, 17 Feb 2022 23:21:07 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4F0849CBA; Thu, 17 Feb 2022 20:20:49 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id u16so1359102pfg.12; Thu, 17 Feb 2022 20:20:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vOM8aB0sk3te+hLK1KNBy8JLp5Cb9O0neMkVeze4/9w=; b=QOqbqdXGzI2ol36L6bTEN8l7GCEHlkS6GwS8hATSvclEZaoEVFL/Q16MlkyoEaw3lP D0le2DDMEDLGefTxj6HtJ3qhQvOgCJ9/RJwcsGXSNPFnkq5YIL+PbUyCvauz23xJYvqn AiBqsh9OBcLnubxobORd1pceB2W7ptCq5phxHim6VMfePYowX+i5Cbqlz0k7PBJncTZO H1x4Fx4OeojlorljbbTakgZF6Mn/BH9NGvuBhxFNwb8NcbEebPbY5BRwYUOaQZPteGLy Axa4sCks6rm46IuA5k8iL4rcO7hT7wydaGIPGF4n9rHNHrFgS0wjaIUAoxHQpfIq5MsF QKYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vOM8aB0sk3te+hLK1KNBy8JLp5Cb9O0neMkVeze4/9w=; b=GZ3Lwv9ddrT3yg2IWtY29wgccE8xKqNP9Obp8FtO762JDur8Oz/pK6PtvhF9ZgVPhM fm7GjE6xpD6ynEIb1iuPSYlLfbo1Q4Do2BgV/mqjc/IYclxkfM5iAR9wkWcxQYy1lnUQ UTHMnatRJmJ/dydEhqAPTrTBPXBhYcT9D927wOXu9SbX/KgePnNm5+aLoZ4a8Dpt5OlH hjawVWs1XsLyzwIOFg5LuJUsceOmeWQqhbFUMKgvpJApW+iSBMnUcH5WbEs7CxqhWQyH O/0Linygb+ee6DDMLYzRZnGNTRSVVQZqcvNXK5KXJA/bKSBYz61cVYXNDhIhWC/ImzKV G/TQ== X-Gm-Message-State: AOAM530V/XcV4mwsFbaoWfJ/x6LUgQR5fTCzjHUgDuALwJodQz2cbfiy LT2cn9O0YacMmMo7xaWHaZE= X-Google-Smtp-Source: ABdhPJzXI5DFxXleHzuIADapJ3smSmpuIMtyvSOh0zCIjmEl2BaEoFUzzKJbCzMcfxCTcKRJmT2Y8w== X-Received: by 2002:a05:6a00:1c47:b0:4e1:2c3a:ac3d with SMTP id s7-20020a056a001c4700b004e12c3aac3dmr5939058pfw.15.1645158049201; Thu, 17 Feb 2022 20:20:49 -0800 (PST) Received: from localhost.localdomain ([60.243.248.66]) by smtp.gmail.com with ESMTPSA id h26sm9530300pgm.72.2022.02.17.20.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:20:48 -0800 (PST) From: Jagath Jog J To: jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com, sst@poczta.fm, robh+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/6] iio: potentiometer: Add available functionality Date: Fri, 18 Feb 2022 09:50:34 +0530 Message-Id: <20220218042038.15176-3-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220218042038.15176-1-jagathjog1996@gmail.com> References: <20220218042038.15176-1-jagathjog1996@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Adding available functionality for DS1803 driver which will show the minimum, step and maximum values that the driver can accepts through sysfs entry. Now using the max value present in avail array instead of chip type specific macro to make the driver flexible to add other type of potentiometer with different max position value. Signed-off-by: Jagath Jog J --- drivers/iio/potentiometer/ds1803.c | 50 ++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 3c542a50ece6..d1e00dda337a 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -16,7 +16,6 @@ #include #include -#define DS1803_MAX_POS 255 #define DS1803_WRITE(chan) (0xa8 | ((chan) + 1)) enum ds1803_type { @@ -26,27 +25,23 @@ enum ds1803_type { }; struct ds1803_cfg { + int avail[3]; int kohms; }; -static const struct ds1803_cfg ds1803_cfg[] = { - [DS1803_010] = { .kohms = 10, }, - [DS1803_050] = { .kohms = 50, }, - [DS1803_100] = { .kohms = 100, }, -}; - struct ds1803_data { struct i2c_client *client; const struct ds1803_cfg *cfg; }; -#define DS1803_CHANNEL(ch) { \ - .type = IIO_RESISTANCE, \ - .indexed = 1, \ - .output = 1, \ - .channel = (ch), \ - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ +#define DS1803_CHANNEL(ch) { \ + .type = IIO_RESISTANCE, \ + .indexed = 1, \ + .output = 1, \ + .channel = (ch), \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ + .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_RAW), \ } static const struct iio_chan_spec ds1803_channels[] = { @@ -54,6 +49,12 @@ static const struct iio_chan_spec ds1803_channels[] = { DS1803_CHANNEL(1), }; +static const struct ds1803_cfg ds1803_cfg[] = { + [DS1803_010] = { .avail = { 0, 1, 255 }, .kohms = 10, }, + [DS1803_050] = { .avail = { 0, 1, 255 }, .kohms = 50, }, + [DS1803_100] = { .avail = { 0, 1, 255 }, .kohms = 100, }, +}; + static int ds1803_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) @@ -75,7 +76,7 @@ static int ds1803_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_SCALE: *val = 1000 * data->cfg->kohms; - *val2 = DS1803_MAX_POS; + *val2 = data->cfg->avail[2]; /* Max wiper position */ return IIO_VAL_FRACTIONAL; } @@ -88,13 +89,14 @@ static int ds1803_write_raw(struct iio_dev *indio_dev, { struct ds1803_data *data = iio_priv(indio_dev); int pot = chan->channel; + int max_pos = data->cfg->avail[2]; if (val2 != 0) return -EINVAL; switch (mask) { case IIO_CHAN_INFO_RAW: - if (val > DS1803_MAX_POS || val < 0) + if (val > max_pos || val < 0) return -EINVAL; break; default: @@ -104,9 +106,25 @@ static int ds1803_write_raw(struct iio_dev *indio_dev, return i2c_smbus_write_byte_data(data->client, DS1803_WRITE(pot), val); } +static int ds1803_read_avail(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, + const int **vals, int *type, int *length, long mask) +{ + struct ds1803_data *data = iio_priv(indio_dev); + + switch (mask) { + case IIO_CHAN_INFO_RAW: + *vals = data->cfg->avail; + *length = ARRAY_SIZE(data->cfg->avail); + *type = IIO_VAL_INT; + return IIO_AVAIL_RANGE; + } + return -EINVAL; +} + static const struct iio_info ds1803_info = { .read_raw = ds1803_read_raw, .write_raw = ds1803_write_raw, + .read_avail = ds1803_read_avail, }; static int ds1803_probe(struct i2c_client *client, const struct i2c_device_id *id) From patchwork Fri Feb 18 04:20:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagath Jog J X-Patchwork-Id: 12750945 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 973E7C433EF for ; Fri, 18 Feb 2022 04:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbiBREVN (ORCPT ); Thu, 17 Feb 2022 23:21:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbiBREVJ (ORCPT ); Thu, 17 Feb 2022 23:21:09 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F971AF075; Thu, 17 Feb 2022 20:20:52 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id v5-20020a17090a4ec500b001b8b702df57so11317063pjl.2; Thu, 17 Feb 2022 20:20:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l5vECSNMgOnnumdzy/X9A35VNb5su3yfGIWvExDKxt8=; b=elnBQXmDA1PO89usj49wd+VEXsjD6qDRr83u12VKDjjS2dODx6q2X4UviPuSxIYrTk n6B7kc0K5O0XwGJx0FuDRq3OtdGXpRbIVRzJcLhvtQxwsL603VOWMQCiLZZ3l57SL9hH nvHjtSzrSvvuACa7UEtNANqWz0bdO7YGSHB6ndvkQcixnGgJNhReE9coca1eCDthlJ6H ZMCUklmGAx3sit2F1NMxNBBog45RpHRKV3jClQufdZBziMT+M2aK12LleV5K7eVi2bCR oI44q3t+OHe9FLyDlsJ0IC/LqEuta7y6QAwcJf4ND6BXfm8v2BLCLZEOdfO+opHYq7ep v4EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l5vECSNMgOnnumdzy/X9A35VNb5su3yfGIWvExDKxt8=; b=i9IOuRAoOXNDBCkrIUTlgtQ66rJcfjDnm6D7R7baXGb4uRH5WlhIq179ENDo+Z3EKW FAKdEJMNw1jgHGoaMp2eAZOLsDPcYHN7ZnNetWwbOHiwPyKPjBRAXNlLamB5dIkjnLy1 +X1BzwGVKzgM/DY6NkeJrvEyPRa7hv/iBHM9myVEg7s/qJpKBk5fk2VL7GSqW6l0KY82 I1ttPnv7bN8FhrFEUTCoimkAAmfmNQQXiXPhdwKz6J7UIypskmUh0YklmhDfmDSIMYFZ nfpj00b8ToHnWGnAfkckrUk+0o+TpVgAXlVjh7ipVGUktEInEbQnIW5VoV3Qh85KJGLl FIZw== X-Gm-Message-State: AOAM532/QcYgEfbRetiUXpbA1qkEdBpAaI/uuotdPJtGJMaB7cHmd0Fo En5e+fvEhiWisz3TAtTnBEQ= X-Google-Smtp-Source: ABdhPJzGGbKiS3wOS2UfrhDMNkllqU33t0WzuRntxZcq5dMHzcCUK5XsEymSs8QfT8u4WrI1cByq6A== X-Received: by 2002:a17:902:7d89:b0:14f:2fed:2461 with SMTP id a9-20020a1709027d8900b0014f2fed2461mr5848003plm.4.1645158051960; Thu, 17 Feb 2022 20:20:51 -0800 (PST) Received: from localhost.localdomain ([60.243.248.66]) by smtp.gmail.com with ESMTPSA id h26sm9530300pgm.72.2022.02.17.20.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:20:51 -0800 (PST) From: Jagath Jog J To: jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com, sst@poczta.fm, robh+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/6] iio: potentiometer: Add channel information in device data Date: Fri, 18 Feb 2022 09:50:35 +0530 Message-Id: <20220218042038.15176-4-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220218042038.15176-1-jagathjog1996@gmail.com> References: <20220218042038.15176-1-jagathjog1996@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Adding each device wiper count and channel information into device private data. Utilizing addr member of struct iio_chan_spec to get the wiper register address so that the value can be read or write to the same address. Signed-off-by: Jagath Jog J --- drivers/iio/potentiometer/ds1803.c | 33 ++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index d1e00dda337a..0ef3acb13c79 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -16,7 +16,8 @@ #include #include -#define DS1803_WRITE(chan) (0xa8 | ((chan) + 1)) +#define DS1803_WIPER_0 0xA9 +#define DS1803_WIPER_1 0xAA enum ds1803_type { DS1803_010, @@ -25,8 +26,11 @@ enum ds1803_type { }; struct ds1803_cfg { + int wipers; int avail[3]; int kohms; + const struct iio_chan_spec *channels; + u8 num_channels; }; struct ds1803_data { @@ -34,25 +38,32 @@ struct ds1803_data { const struct ds1803_cfg *cfg; }; -#define DS1803_CHANNEL(ch) { \ +#define DS1803_CHANNEL(ch, addr) { \ .type = IIO_RESISTANCE, \ .indexed = 1, \ .output = 1, \ .channel = (ch), \ + .address = (addr), \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_RAW), \ } static const struct iio_chan_spec ds1803_channels[] = { - DS1803_CHANNEL(0), - DS1803_CHANNEL(1), + DS1803_CHANNEL(0, DS1803_WIPER_0), + DS1803_CHANNEL(1, DS1803_WIPER_1), }; static const struct ds1803_cfg ds1803_cfg[] = { - [DS1803_010] = { .avail = { 0, 1, 255 }, .kohms = 10, }, - [DS1803_050] = { .avail = { 0, 1, 255 }, .kohms = 50, }, - [DS1803_100] = { .avail = { 0, 1, 255 }, .kohms = 100, }, + [DS1803_010] = { .wipers = 2, .avail = { 0, 1, 255 }, .kohms = 10, + .channels = ds1803_channels, + .num_channels = ARRAY_SIZE(ds1803_channels) }, + [DS1803_050] = { .wipers = 2, .avail = { 0, 1, 255 }, .kohms = 50, + .channels = ds1803_channels, + .num_channels = ARRAY_SIZE(ds1803_channels) }, + [DS1803_100] = { .wipers = 2, .avail = { 0, 1, 255 }, .kohms = 100, + .channels = ds1803_channels, + .num_channels = ARRAY_SIZE(ds1803_channels) }, }; static int ds1803_read_raw(struct iio_dev *indio_dev, @@ -88,7 +99,7 @@ static int ds1803_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) { struct ds1803_data *data = iio_priv(indio_dev); - int pot = chan->channel; + u8 addr = chan->address; int max_pos = data->cfg->avail[2]; if (val2 != 0) @@ -103,7 +114,7 @@ static int ds1803_write_raw(struct iio_dev *indio_dev, return -EINVAL; } - return i2c_smbus_write_byte_data(data->client, DS1803_WRITE(pot), val); + return i2c_smbus_write_byte_data(data->client, addr, val); } static int ds1803_read_avail(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, @@ -144,8 +155,8 @@ static int ds1803_probe(struct i2c_client *client, const struct i2c_device_id *i data->cfg = &ds1803_cfg[id->driver_data]; indio_dev->info = &ds1803_info; - indio_dev->channels = ds1803_channels; - indio_dev->num_channels = ARRAY_SIZE(ds1803_channels); + indio_dev->channels = data->cfg->channels; + indio_dev->num_channels = data->cfg->num_channels; indio_dev->name = client->name; return devm_iio_device_register(dev, indio_dev); From patchwork Fri Feb 18 04:20:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagath Jog J X-Patchwork-Id: 12750946 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 E0186C433FE for ; Fri, 18 Feb 2022 04:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiBREVP (ORCPT ); Thu, 17 Feb 2022 23:21:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiBREVM (ORCPT ); Thu, 17 Feb 2022 23:21:12 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB2C1AF068; Thu, 17 Feb 2022 20:20:55 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id z17so6214598plb.9; Thu, 17 Feb 2022 20:20:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O7HIMK8IeakhG50GR/Ulau2dXDnZ+c8G1mQzoOKGfhY=; b=BeOANZqC8rHdl8tNubhuKoq5r1UNKGKN09+Bd/Yif2M9fNDNfj58u9POY6hQzBYyVf Iz9+x3HF1+HBN/g9hP6QHHziFKk71k6Vu+60dTODQ3l6AaX1iifGTuwQt6FgLVkB+JdI W6XAzjQdOaNbAtIq06KpDIgP1gL498kco+iO1NxNQN3/9ok9ukheqk3ipmO/gclxidfn /P+SV+CW6ri3sYUzfMFKhtYhiTuYY6b8hq9pzfGnpBE+VAkhvDx0u068Ml3M6TkLXJdC 3W1Ik/VNSmUcYN9W61E82mZg/sSAXPWa77XDc3Bi/uN62VQRkbP++HT7RHGt9R/dHVB+ krZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O7HIMK8IeakhG50GR/Ulau2dXDnZ+c8G1mQzoOKGfhY=; b=lXrIuwGqtExep/rRgkfPVl7F46pYoliVANE0Sdz1yCSPPcA9dgPaeLTjfOF96zJlSF PizFrAqM1Bgz7fqKekdLo7b9NcTFy9GHTeDuI5I9LuP70cKJgBO9wZJt5xpNBDdP95rn 15Kr1pi5Yen94H6zivP42JnU+wgqkEWr+HQyKgnP9JC6QP5Oz272/BW7veLa2xUv1y8A svFInaWDA4L0K8cX7Yc5+tozgCRInMOVYPuD6LIUfyJuNFJm0Hvj7JDoBxNN7BKLnqhN 31KCux3+ORiipATWUmE90MU2M0MzyGA4El1glkOwFbQBflvH+J2uoR0VVV7G+3ggR9TS V1Sw== X-Gm-Message-State: AOAM532Fde2k0/CiiiesNvA4frlqX03Enivb8/eopNo/2GEWodMjBVRe Hmw+UrIayYiJwQBphQn9tfU= X-Google-Smtp-Source: ABdhPJzaBpxIn/ff4O9KAnry8TtL+YNcJvdNBastNPqQ2g3NCuT3kTy5WfIcAr1NxYnEVBSs0JqeCA== X-Received: by 2002:a17:902:d2cc:b0:14d:a21a:cbb6 with SMTP id n12-20020a170902d2cc00b0014da21acbb6mr5719394plc.34.1645158054628; Thu, 17 Feb 2022 20:20:54 -0800 (PST) Received: from localhost.localdomain ([60.243.248.66]) by smtp.gmail.com with ESMTPSA id h26sm9530300pgm.72.2022.02.17.20.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:20:54 -0800 (PST) From: Jagath Jog J To: jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com, sst@poczta.fm, robh+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/6] iio: potentiometer: Change to firmware provided data Date: Fri, 18 Feb 2022 09:50:36 +0530 Message-Id: <20220218042038.15176-5-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220218042038.15176-1-jagathjog1996@gmail.com> References: <20220218042038.15176-1-jagathjog1996@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Using firmware provided data to get the device specific structure, if not available fall back to id->driver_data. Signed-off-by: Jagath Jog J --- drivers/iio/potentiometer/ds1803.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 0ef3acb13c79..ca28ad147402 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -152,7 +152,9 @@ static int ds1803_probe(struct i2c_client *client, const struct i2c_device_id *i data = iio_priv(indio_dev); data->client = client; - data->cfg = &ds1803_cfg[id->driver_data]; + data->cfg = device_get_match_data(dev); + if (!data->cfg) + data->cfg = &ds1803_cfg[id->driver_data]; indio_dev->info = &ds1803_info; indio_dev->channels = data->cfg->channels; From patchwork Fri Feb 18 04:20:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagath Jog J X-Patchwork-Id: 12750947 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 E5A56C433F5 for ; Fri, 18 Feb 2022 04:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbiBREVR (ORCPT ); Thu, 17 Feb 2022 23:21:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiBREVN (ORCPT ); Thu, 17 Feb 2022 23:21:13 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3BE31AE2EA; Thu, 17 Feb 2022 20:20:57 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id t4-20020a17090a510400b001b8c4a6cd5dso7376450pjh.5; Thu, 17 Feb 2022 20:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fY4fw1P6g60UFW9BgNtnccPQ/82yWPQRO5vRCK+fANs=; b=ClCdP2CDl+Z+jFxnhyUJIcQ7+OoRriDR23TWylekktSYR4K/2d+OUFJRPJAbsgv3ea h4bC8ReUaU/D/dxxLqjkGnOL696ZaBG3OtkFoewqXaL0yGNA9fZX1HDALqkRdNNSiQTi 8rdKK0LeaemLxNhVkD5IC6hOaOp7c1InhR7ufR0sBx9sszRTqHEbVMIuBhWbSLsVEmoQ 5WktYa9itfPbNBxtbw0ElyO+LB2o/CZyw+GqTy8Lm2IOrruCm5JwAQA3C4R6Bd3UZ17u D9+fD9uDvWnCjnJPs1VewDz78/iqQ1/+OyE8695njdHuFK+TbZI40Ut0V3c2NqYk0gmE fQKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fY4fw1P6g60UFW9BgNtnccPQ/82yWPQRO5vRCK+fANs=; b=RTQXhOBNWvWivPcGzNtfyaCzxx0Kg1RjflIzE7g/eqwKlkLZ14c0Zl+Ij55dgVPt6z KmdzQSdob1iVc6/zfSZM9AN6XH8E2PzoTps1fM0C+56sZIPGM/HIX+gqwTnI67A9LyZj Z6XUHxfaG2Iih3eEgmWmg24LKn20EJ2jxVrPC7FgTFxgPK9M9XS7xuzXZ11l3cr+8li/ 2nJF5DNASodbyH+hx/EU6Mvr62P4B2M1INCFqDQsS8z1HOnpfj/MGAjH8SAbdo4Tjrw6 Hzvn+oDYzv5ruCsqtvI3Kee9yM7uu+H9ygyEUjfQdQRhduYhg4bjOQhsdCHOcsnEZTxF KbUQ== X-Gm-Message-State: AOAM530UEC1isWpLX1ICMwYHJ1OATDdDdYXGYwFXgL7PF0vaRV/m4s4F A5X4NJO2DOQx+/wq3Cnqzm2mIBDqEaRa3EBA X-Google-Smtp-Source: ABdhPJwjU060BnmToi8aTv75GIOWO/bO9dX92GyVfzNIP6IopoFtWxnQlJxge7H0+KRxXIwcHSGefg== X-Received: by 2002:a17:90b:4391:b0:1b8:efac:58b6 with SMTP id in17-20020a17090b439100b001b8efac58b6mr10558860pjb.60.1645158057224; Thu, 17 Feb 2022 20:20:57 -0800 (PST) Received: from localhost.localdomain ([60.243.248.66]) by smtp.gmail.com with ESMTPSA id h26sm9530300pgm.72.2022.02.17.20.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:20:56 -0800 (PST) From: Jagath Jog J To: jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com, sst@poczta.fm, robh+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/6] iio: potentiometer: Add support for Maxim DS3502 Date: Fri, 18 Feb 2022 09:50:37 +0530 Message-Id: <20220218042038.15176-6-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220218042038.15176-1-jagathjog1996@gmail.com> References: <20220218042038.15176-1-jagathjog1996@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The DS3502 is a 7-bit, nonvolatile digital potentiometer featuring an output voltage range of up to 15.5V. DS3502 support is implemented into existing DS1803 driver. Datasheet: https://datasheets.maximintegrated.com/en/ds/DS3502.pdf Signed-off-by: Jagath Jog J --- drivers/iio/potentiometer/Kconfig | 6 ++-- drivers/iio/potentiometer/ds1803.c | 46 ++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/drivers/iio/potentiometer/Kconfig b/drivers/iio/potentiometer/Kconfig index 832df8da2bc6..79c524640196 100644 --- a/drivers/iio/potentiometer/Kconfig +++ b/drivers/iio/potentiometer/Kconfig @@ -27,11 +27,11 @@ config AD5272 module will be called ad5272. config DS1803 - tristate "Maxim Integrated DS1803 Digital Potentiometer driver" + tristate "Maxim Integrated DS1803 and similar Digital Potentiometer driver" depends on I2C help - Say yes here to build support for the Maxim Integrated DS1803 - digital potentiometer chip. + Say yes here to build support for the Maxim Integrated Devices DS1803 and + DS3502 digital potentiometer chip. To compile this driver as a module, choose M here: the module will be called ds1803. diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index ca28ad147402..ca903e9c2816 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -1,12 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Maxim Integrated DS1803 digital potentiometer driver + * Maxim Integrated DS1803 and similar digital potentiometer driver * Copyright (c) 2016 Slawomir Stepien + * Copyright (c) 2022 Jagath Jog J * * Datasheet: https://datasheets.maximintegrated.com/en/ds/DS1803.pdf + * Datasheet: https://datasheets.maximintegrated.com/en/ds/DS3502.pdf * * DEVID #Wipers #Positions Resistor Opts (kOhm) i2c address * ds1803 2 256 10, 50, 100 0101xxx + * ds3502 1 128 10 01010xx */ #include @@ -18,11 +21,13 @@ #define DS1803_WIPER_0 0xA9 #define DS1803_WIPER_1 0xAA +#define DS3502_WR_IVR 0x00 enum ds1803_type { DS1803_010, DS1803_050, DS1803_100, + DS3502, }; struct ds1803_cfg { @@ -36,6 +41,7 @@ struct ds1803_cfg { struct ds1803_data { struct i2c_client *client; const struct ds1803_cfg *cfg; + enum ds1803_type chip_type; }; #define DS1803_CHANNEL(ch, addr) { \ @@ -54,6 +60,10 @@ static const struct iio_chan_spec ds1803_channels[] = { DS1803_CHANNEL(1, DS1803_WIPER_1), }; +static const struct iio_chan_spec ds3502_channels[] = { + DS1803_CHANNEL(0, DS3502_WR_IVR), +}; + static const struct ds1803_cfg ds1803_cfg[] = { [DS1803_010] = { .wipers = 2, .avail = { 0, 1, 255 }, .kohms = 10, .channels = ds1803_channels, @@ -64,6 +74,9 @@ static const struct ds1803_cfg ds1803_cfg[] = { [DS1803_100] = { .wipers = 2, .avail = { 0, 1, 255 }, .kohms = 100, .channels = ds1803_channels, .num_channels = ARRAY_SIZE(ds1803_channels) }, + [DS3502] = { .wipers = 1, .avail = { 0, 1, 127 }, .kohms = 10, + .channels = ds3502_channels, + .num_channels = ARRAY_SIZE(ds3502_channels) }, }; static int ds1803_read_raw(struct iio_dev *indio_dev, @@ -77,13 +90,26 @@ static int ds1803_read_raw(struct iio_dev *indio_dev, switch (mask) { case IIO_CHAN_INFO_RAW: - ret = i2c_master_recv(data->client, result, - indio_dev->num_channels); - if (ret < 0) - return ret; - - *val = result[pot]; - return IIO_VAL_INT; + switch (data->chip_type) { + case DS1803_010: + case DS1803_050: + case DS1803_100: + ret = i2c_master_recv(data->client, result, + indio_dev->num_channels); + if (ret < 0) + return ret; + *val = result[pot]; + return IIO_VAL_INT; + case DS3502: + ret = i2c_smbus_read_byte_data(data->client, + chan->address); + if (ret < 0) + return ret; + *val = ret; + return IIO_VAL_INT; + default: + return -EINVAL; + } case IIO_CHAN_INFO_SCALE: *val = 1000 * data->cfg->kohms; @@ -156,6 +182,7 @@ static int ds1803_probe(struct i2c_client *client, const struct i2c_device_id *i if (!data->cfg) data->cfg = &ds1803_cfg[id->driver_data]; + data->chip_type = id->driver_data; indio_dev->info = &ds1803_info; indio_dev->channels = data->cfg->channels; indio_dev->num_channels = data->cfg->num_channels; @@ -168,6 +195,7 @@ static const struct of_device_id ds1803_dt_ids[] = { { .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] }, { .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] }, { .compatible = "maxim,ds1803-100", .data = &ds1803_cfg[DS1803_100] }, + { .compatible = "maxim,ds3502", .data = &ds1803_cfg[DS3502] }, {} }; MODULE_DEVICE_TABLE(of, ds1803_dt_ids); @@ -176,6 +204,7 @@ static const struct i2c_device_id ds1803_id[] = { { "ds1803-010", DS1803_010 }, { "ds1803-050", DS1803_050 }, { "ds1803-100", DS1803_100 }, + { "ds3502", DS3502 }, {} }; MODULE_DEVICE_TABLE(i2c, ds1803_id); @@ -192,5 +221,6 @@ static struct i2c_driver ds1803_driver = { module_i2c_driver(ds1803_driver); MODULE_AUTHOR("Slawomir Stepien "); +MODULE_AUTHOR("Jagath Jog J "); MODULE_DESCRIPTION("DS1803 digital potentiometer"); MODULE_LICENSE("GPL v2"); From patchwork Fri Feb 18 04:20:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagath Jog J X-Patchwork-Id: 12750949 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 A7827C433EF for ; Fri, 18 Feb 2022 04:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbiBREVX (ORCPT ); Thu, 17 Feb 2022 23:21:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbiBREVQ (ORCPT ); Thu, 17 Feb 2022 23:21:16 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F7971B0A30; Thu, 17 Feb 2022 20:21:00 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id w1so6222687plb.6; Thu, 17 Feb 2022 20:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bcgt5PK1Q0mp9E0RmLUvcE/cB/2glUg86KZveaMOtXU=; b=C9ypeM/CKWvbodCJOdNi/gxpPmZTeHpNPvHZTvvXQlhYMQlBTKZ6H/e+Sz+SCS4GLG 1INrS0EPhh5AjszltH74Sr9hRbrQp3fEOniA1Z6LLhWVnkROoqemCcQozMfBUEHufPHq cYoaSAgUNHCv1eXUnMdD42izE5hLtntqBokAcrjLoaIdE1BaDfshqTDSzt5KRYJQbgxk Ody9DRkovZUieGicW1T84rIyotfWCXa73Aqu21LEKzSxjlgQi43VAt8j9rqXVYUDC0c8 OE0Tdh8NiFmt4H5ll1cADUQOVAhEfzgTZqFaowGl+Y8MHShOe9XcrH7TwN9zgQ+waoT8 n0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bcgt5PK1Q0mp9E0RmLUvcE/cB/2glUg86KZveaMOtXU=; b=ITdtsj+IIvpnkIBBo3aOqTuAL6cbyZl/LYeiZV9rQMSqV2sVGiHnI2SKTSXf6cuzXh wOf59Dzop8HXhZ1hMD93w3xyaulE3URC4sQOMK7HnGGu1yFoYx5EMbNlIJbb4sUj2ZJ0 BJc/4sZGY/LQYINiUCHS0h774oXDSxbnuvtGft7ME3UOJmSfjgvFzyrYmAipoephQ/tq XVt3ZAyrt9qlgDLSz6pS0yQGOQk9qs0HgpckUr7U/Pc1OopcnuTUoD5LqWtFvM1lzW/X +oeWIMIgznNl3IIl6IrCk1/ytUrltrudpDe8wYqQPlQFPmYJ166L+iBwxh9yBTgcgT+3 y83g== X-Gm-Message-State: AOAM533deJNDnOPQxrW9RNWPTmHfuDVm6J9nhW/yeLesaXr7s51y0CZK D97sT+YJmD6Rtnd+OsFr39A= X-Google-Smtp-Source: ABdhPJzw/42FdPwT9VUX3kY0fyQEO9XvZa5n8i/BQZLqS/3ia96z/DkJX/UytGuvgZmlKwFBFJbbfQ== X-Received: by 2002:a17:902:ce91:b0:14e:dad4:5ce2 with SMTP id f17-20020a170902ce9100b0014edad45ce2mr4552109plg.120.1645158059871; Thu, 17 Feb 2022 20:20:59 -0800 (PST) Received: from localhost.localdomain ([60.243.248.66]) by smtp.gmail.com with ESMTPSA id h26sm9530300pgm.72.2022.02.17.20.20.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:20:59 -0800 (PST) From: Jagath Jog J To: jic23@kernel.org, lars@metafoo.de, andy.shevchenko@gmail.com, sst@poczta.fm, robh+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/6] dt-bindings: iio: potentiometer: Add Maxim DS3502 in trivial-devices Date: Fri, 18 Feb 2022 09:50:38 +0530 Message-Id: <20220218042038.15176-7-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220218042038.15176-1-jagathjog1996@gmail.com> References: <20220218042038.15176-1-jagathjog1996@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Maxim DS3502 is a 7 bit nonvolatile digital potentiometer. Add DS3502 binding into trivial-devices.yaml. Signed-off-by: Jagath Jog J Acked-by: Rob Herring --- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index 091792ba993e..b6187603317a 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -157,6 +157,8 @@ properties: - maxim,ds1803-050 # 100 kOhm digital potentiometer with I2C interface - maxim,ds1803-100 + # 10 kOhm digital potentiometer with I2C interface + - maxim,ds3502 # Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs - maxim,max1237 # Temperature Sensor, I2C interface