Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753637AbcDAIdJ (ORCPT ); Fri, 1 Apr 2016 04:33:09 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:38385 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbcDAIdE (ORCPT ); Fri, 1 Apr 2016 04:33:04 -0400 MIME-Version: 1.0 In-Reply-To: <6b5caa6c47c34d5eaa302dccf8dd89aa@EMAIL.axentia.se> References: <1458818485-2770-1-git-send-email-cristina.moraru09@gmail.com> <6b5caa6c47c34d5eaa302dccf8dd89aa@EMAIL.axentia.se> Date: Fri, 1 Apr 2016 11:33:03 +0300 X-Google-Sender-Auth: JPjN6mUI3wEX5G6A-sHCJSd961Y Message-ID: Subject: Re: [PATCH] iio: max5487: Add support for Maxim digital potentiometers From: Daniel Baluta To: Peter Rosin Cc: Cristina Moraru , "jic23@kernel.org" , "knaack.h@gmx.de" , "lars@metafoo.de" , "pmeerw@pmeerw.net" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" , "daniel.baluta@intel.com" , "octavian.purdila@intel.com" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1119 Lines: 28 On Fri, Mar 25, 2016 at 12:20 PM, Peter Rosin wrote: > Hi again, > > Cristina Moraru wrote: >> Add implementation for Maxim MAX5487, MAX5488, MAX5489 >> digital potentiometers. >> >> Signed-off-by: Cristina Moraru >> CC: Daniel Baluta > > Some more comments, the mcp4531 chips have n**2 + 1 positions, > therefore .max_pos in that driver isn't the number of wiper positions, it's > the actual maximum value. So, in this driver, the corrent number for > .max_pos would be 255, otherwise the reported scale is wrong (and then > you also need to adjust the EINVAL check in max5487_write_raw to use > > instead of >=). > > Further comparison with the mcp4531 driver reveals that this driver does > not support IIO_CHAN_INFO_RAW in max5487_read_raw. I assume the SPI > interface does not support reading back the current value? Yes. The registers are write only. We could have used the caching facility of regmap with default values. The problem is when using the non volatile (NV) mem there is no way to know the previous wiper position. Daniel.