Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1298023imu; Tue, 11 Dec 2018 16:57:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XIBgSUmucal92GzbPOcXd3o7Gfqt247FbY1r4Q3gHbU6SVCev+ASnAhEptGn/PIAogiZfV X-Received: by 2002:a17:902:5ac7:: with SMTP id g7mr18339534plm.212.1544576250611; Tue, 11 Dec 2018 16:57:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544576250; cv=none; d=google.com; s=arc-20160816; b=I952fzXtdd+GltXlWbQLQnWTkaX6N0OJmMvaZJudpGnX+dIvhSj5uVI2uHJTtmNVl2 sy2QaJ+K3vmH20MwUrdxxk37QQIeo629WuefDahDwVn3PZpM1+wcfS9dhlZuwzp7oniM mSGPFwgWq+BJTOPipJqMrqABNwzy0pSa5AvyvXTP5VHfymH5uwkLe+uSv1/CU2utJfvH nGsytn2uH41hHEDmAytFZhVMdexEYibNBE0wnOIS71U2Ab1DuoMhi11e7GtMHWjWl9FY xS+z2GJ0Gd5Gpvv6qkvDB3L5lddfC3BV8OfOgIr9OFcv0bUeWpm9QYtpPZY/XtHCLu7C /1yg== 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:date:subject:cc:to:from :dkim-signature; bh=L/atx7BGCxztBzsTRzroAA6bFNlexZMNZDiBGowfY84=; b=M+TL9zmQKV5h04NnoqW+gkYluLufrpKHColiEn+O7ZqUYM9gVjs6+JlP0pOKlerXa/ 38bDDEtwuh4HU07YvFf0BfoS2K8fTUQcIrPzkpX+/Xx8d6i/zG8OBzLzbDN3qxmPEg8I k2nKMFqUe3pxg720pZeDOEazaj3SsUussp9uhgja4MGqlhlyHf75G7nf1SaXW205o/B+ vp268s4qADfJRq79wT+M43XTsnbAxqB/RFXbteyaEpKz+SHsTPJSspGxr5JKOC0EO4la BqfAf1m9dktzqM7oNsxK7tNDy7yU0Xg3GTv+NXXonmyVczO4v3pxLInOltZlRdaBJB7H P4Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YTgUhfA3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j186si15197807pfb.35.2018.12.11.16.57.16; Tue, 11 Dec 2018 16:57:30 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YTgUhfA3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbeLLAzz (ORCPT + 99 others); Tue, 11 Dec 2018 19:55:55 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:34181 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbeLLAzv (ORCPT ); Tue, 11 Dec 2018 19:55:51 -0500 Received: by mail-io1-f68.google.com with SMTP id r9so13509003ioa.1; Tue, 11 Dec 2018 16:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L/atx7BGCxztBzsTRzroAA6bFNlexZMNZDiBGowfY84=; b=YTgUhfA3XhydP/im3xH6xglj1N2s9OHvGOGTkriBOvGGU150UMBz5iqAjyQ0daUPIu kEUan9F49Owy953ty7gDVs6CY4sx7XrN3LXoG4g/P2Wqd3FWEYhe2Z2SPXpFqR+4aK+K t+gP598UpePVn1DDRNNM7+BeV0iKY6BTTguGCr12/StVEcZspDRkMo7/vXKA9t+aplAk A7ZRUBQSrBJXgoOS8Y4MI262kqKQAgy5GnwVU2C3CTLBQD0us/MLMReUwLUE5hYDffFf RinoZaOtG60QcgOqwY8kU/m8xEQEQHqBvliORX0cfI5nPW9o5ot41afUYEfzPno6XQ04 55XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L/atx7BGCxztBzsTRzroAA6bFNlexZMNZDiBGowfY84=; b=an3bFm5/1RBzhVkMjbjDq4CuPpvXmSvdRXQnk91bUgotcu1cD5rswLxDp1/v/ZV8KL UaEGRfipHXVV4p97p5qxSmNBdVOtMFTQI++h++tLQzxBRcwhJFNwObUKzodFt0sMyJHY uh7o/omu0oxdpF3pDuzmeOrxmFJV0sdEtbEb90/f+Ttusc87LY1IGm7VWhQpKxSAnOcL TOhvU/OPfrM0WovrFW43aUpHCe+aZWchiZJppquyZa1csuuDvr/POeo0uWLXHtWqOcxR /+pWu30h2mIHyUrfiSlc9B+ithLwDb6EhQ8MvrfVKH/GOpLA0sAEGJKqTKjZyedw6DNW RYiw== X-Gm-Message-State: AA+aEWbVJiIGGk2/yhT1YccLjeMBw2qxuMU/kpj5S3wgKkbg3iYDCgIG Mr9IU4eCqgvVeIER8m++4Pw= X-Received: by 2002:a5d:9b9a:: with SMTP id r26mr15497659iom.232.1544576149999; Tue, 11 Dec 2018 16:55:49 -0800 (PST) Received: from r2700x.localdomain (c-75-70-96-103.hsd1.co.comcast.net. [75.70.96.103]) by smtp.gmail.com with ESMTPSA id l186sm1952445itl.22.2018.12.11.16.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 16:55:49 -0800 (PST) From: Jeremy Fertic To: Jonathan Cameron Cc: Lars-Peter Clausen , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Jeremy Fertic Subject: [PATCH 07/11] staging: iio: adt7316: use correct variable in DAC_internal_Vref read Date: Tue, 11 Dec 2018 17:54:59 -0700 Message-Id: <20181212005503.28054-8-jeremyfertic@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181212005503.28054-1-jeremyfertic@gmail.com> References: <20181212005503.28054-1-jeremyfertic@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dac internal vref settings are part of the ldac config register rather than the dac config register. Change the variable being used so the read returns the correct result. Signed-off-by: Jeremy Fertic --- drivers/staging/iio/addac/adt7316.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 77ef3c209b67..98101a7157d2 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -1056,10 +1056,10 @@ static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev, if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX) return sprintf(buf, "0x%x\n", - (chip->dac_config & ADT7516_DAC_IN_VREF_MASK) >> + (chip->ldac_config & ADT7516_DAC_IN_VREF_MASK) >> ADT7516_DAC_IN_VREF_OFFSET); return sprintf(buf, "%d\n", - !!(chip->dac_config & ADT7316_DAC_IN_VREF)); + !!(chip->ldac_config & ADT7316_DAC_IN_VREF)); } static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev, -- 2.19.1