Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11814105pjo; Thu, 2 Jan 2020 14:44:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwYgTG8oAF5NTwJ5sS+JY0y/oE19ixF05hdQbRps07L3PI+bJ70qg3W+IPkAJELRf6FD1om X-Received: by 2002:aca:500f:: with SMTP id e15mr3314660oib.172.1578005089507; Thu, 02 Jan 2020 14:44:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005089; cv=none; d=google.com; s=arc-20160816; b=EoFGE3HFvBuP1B+XiPiQ1m7mhpAC3FuO5th7/As9ZdzPgykGpq5FFLKXwPIYqAGKyN 4I23g7gvsAsCtOfaEhwRyA602waxkAQTH6og/NZMquUO06RSKa3CHHirRGEm6ptxomfz JeWlU5fgL7KfBQbH+FEiczKRG61pIbV9Y/ZR6yWsOx7YsolmXICtHbSEINg+4BXQcSsA P3ZKLuKynEBrCgS256zD/ZVzlRJRZ2DXqiKHvMsp1GyMvcnjhVxW50sHJ87902oOAUFr l6jtG+GQn7Vx36/nGHJsqXNSmrH+BqX2raUCPWD3uZpG1Rp0VpjdTt8Kmfzx9aAwjtAG bqDg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xjIzgop3z28vJtDQwg8qJZInEbMv5EyU4IumaCqUS24=; b=rLG3xFsSWQP+2QC70uiHPqAjxMETOCzje10dfXNxg5vWtXrCsdycnGnkqQGe1ajdGO DiqwaTH9wefYYmwCr4mt7Y2yWvxyYrRry1oqcpYpVWn1sKG0U2mzlDjP5QsM14TxUl0D VGQWybYphe6cMIL2UXbMQNgSiUxBnSa4NTRsmioR+jcWId9okqGuRFDXTnZLERbVYh1H Ko4/8X2FNb+mWXKLIoZY8Xo9UKXIZwmJddSUY6QyP/q4NxGOhn5NK0eDXKZHdpZtokoD B99duCykuRkkGBsmaQLZQ/kTmZXGFcYfjmgSL5cq1P+lWN1TEvRFXKbduzjve0G3Y2li qgTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TYJQDMN6; 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 13si21051138oiy.28.2020.01.02.14.44.38; Thu, 02 Jan 2020 14:44:49 -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=@kernel.org header.s=default header.b=TYJQDMN6; 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 S1731323AbgABWmd (ORCPT + 99 others); Thu, 2 Jan 2020 17:42:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:45956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730597AbgABWfu (ORCPT ); Thu, 2 Jan 2020 17:35:50 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 77B2F20863; Thu, 2 Jan 2020 22:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004549; bh=kI714KhdZOV86NSLDIwxv61nxxSXvDcFcQ6Rb3avn6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TYJQDMN6kdbaj/jtF1pxTD6qGZz8EozPR/BEV0m/8jgp2QnLzenrv/HHIFijHpHqQ KlIUARVHtujL2Nfm76zYlo9F00GYMCxJikuk9NXcSX/XIVhTBQ41bWtCN2yhKZSMnM yspolCxPHxVXP+K0Gh8HtPKUnjTpxzjTHUkFC4eA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.4 028/137] iio: adc: max1027: Reset the device at probe time Date: Thu, 2 Jan 2020 23:06:41 +0100 Message-Id: <20200102220550.401050486@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miquel Raynal [ Upstream commit db033831b4f5589f9fcbadb837614a7c4eac0308 ] All the registers are configured by the driver, let's reset the chip at probe time, avoiding any conflict with a possible earlier configuration. Signed-off-by: Miquel Raynal Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/adc/max1027.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index 41d495c6035e..7d5e4114e7a8 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -470,6 +470,14 @@ static int max1027_probe(struct spi_device *spi) goto fail_dev_register; } + /* Internal reset */ + st->reg = MAX1027_RST_REG; + ret = spi_write(st->spi, &st->reg, 1); + if (ret < 0) { + dev_err(&indio_dev->dev, "Failed to reset the ADC\n"); + return ret; + } + /* Disable averaging */ st->reg = MAX1027_AVG_REG; ret = spi_write(st->spi, &st->reg, 1); -- 2.20.1