Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp643067img; Wed, 20 Mar 2019 08:00:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwK9C+hIEnbae6T66R6pcg11BHAe0GLnyMNTD2nY5Vebg+5pSA7WTyA7FfXlsq7L2LDiirh X-Received: by 2002:a63:ef05:: with SMTP id u5mr7826839pgh.177.1553094006627; Wed, 20 Mar 2019 08:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553094006; cv=none; d=google.com; s=arc-20160816; b=InV8LfWnqz9wScpjOykrSMYPnlho69J6HEL3HisxpSVogBNeis8iPH5+A6An2Po4YI KuJa0CTqVYV2H+cCkweHr47kUh2SEOOlcHXDv7LScSPhz4skv5vRLdx9JGjHuTtT+ha4 GgzC6+L7jHpm6X0RFDWfrrhodcLc/ii1gYuvb8o5osv/D2qGr9hcKcX7rgLE56FY6pCk fBbqgLVzynbTJjvwNtzvWVbPB263Pm0daJgLaWU0n2XkElTms4oHTVP9XjZsfeVYz7m2 Ad2Xr2srqCQt1xtAwqg3xC1ql/0YwSv/Kz6C+3OyZiUw7UDt2WEdQh8gigQ+63kvMtJc RuSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Pn2zqpSTg7BXaW0aZE/1DQMB3IgUMG1P0/rftiDgXUE=; b=tnMqyHzVJL52A7zxFw+f+FSG+Ss5A6qqIasu5G83onfml8YU6UNM/vrX30FdMpAsaE tA69hmu1bxCYMBhi138voOzH9Qs+4oezKNYLzP4bFjTSsJK3TQu1VMZPX6dlaEv2kGM/ 1FGO7zKAibwq0qjUogI2yopjX2qhVZADvERlb6wy+VfJ5XFp0Xk7PMJvwsDpFkw75487 QAeV0BRGPg1OBU9Ynn7auTXGhd80giHLd2FQxir1KKXbCv18OeN+IiMVBB+CESmoSedf jS1qmDQsX9gheoslvrDdzyHatanOaGTk8ae0GexSuoyvognnr6u4y9RZAsQ1+jVbwpxV rwjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x64si1762024pfx.156.2019.03.20.07.59.50; Wed, 20 Mar 2019 08:00:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728329AbfCTO7F (ORCPT + 99 others); Wed, 20 Mar 2019 10:59:05 -0400 Received: from hosting.pavoucek.net ([46.28.107.168]:55592 "EHLO hosting.pavoucek.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727248AbfCTO7F (ORCPT ); Wed, 20 Mar 2019 10:59:05 -0400 X-Greylist: delayed 338 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 Mar 2019 10:59:04 EDT Received: from tomas.local.tbs-biometrics.cz (unknown [176.74.132.138]) (Authenticated sender: tomas@novotny.cz) by hosting.pavoucek.net (Postfix) with ESMTPSA id 65E66102FFE; Wed, 20 Mar 2019 15:53:22 +0100 (CET) Date: Wed, 20 Mar 2019 15:53:22 +0100 From: Tomas Novotny To: "Angus Ainslie (Purism)" Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/5] iio: light: vcnl4000 use word writes instead of byte writes Message-ID: <20190320155322.3fd9f080@tomas.local.tbs-biometrics.cz> In-Reply-To: <20190317154802.15174-2-angus@akkea.ca> References: <20190317154802.15174-1-angus@akkea.ca> <20190317154802.15174-2-angus@akkea.ca> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Angus, On Sun, 17 Mar 2019 08:47:58 -0700 "Angus Ainslie (Purism)" wrote: > The VCNL4200 datasheet says that word read and writes should be used > to access the registers. > > Signed-off-by: Angus Ainslie (Purism) > --- > drivers/iio/light/vcnl4000.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c > index 04fd0d4b6f19..5295330b65e2 100644 > --- a/drivers/iio/light/vcnl4000.c > +++ b/drivers/iio/light/vcnl4000.c > @@ -140,10 +140,10 @@ static int vcnl4200_init(struct vcnl4000_data *data) > data->rev = (ret >> 8) & 0xf; > > /* Set defaults and enable both channels */ > - ret = i2c_smbus_write_byte_data(data->client, VCNL4200_AL_CONF, 0x00); > + ret = i2c_smbus_write_word_data(data->client, VCNL4200_AL_CONF, 0x00); minor note: the 0x00 looks like a byte. 0 or 0x0000 would be slightly better? The same below. > if (ret < 0) > return ret; > - ret = i2c_smbus_write_byte_data(data->client, VCNL4200_PS_CONF1, 0x00); > + ret = i2c_smbus_write_word_data(data->client, VCNL4200_PS_CONF1, 0x00); The VCNL4200_PS_CONF1 definition is a bit misleading with word write. Because PS_CONF1 is only a low byte of command code 0x03. The high byte of 0x03 is PS_CONF2. I would rename it. > if (ret < 0) > return ret; Anyway, the main point is that I've tested this patch on VCNL4200 and it works, so: Tested-by: Tomas Novotny T.