Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1405661pxb; Fri, 21 Jan 2022 17:54:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVoSq3uHcs+VLsPUNAM4QmU92S/fZGsbckjguPux7N7XuVq51a0FCCOwjwAG22EhkuU4bv X-Received: by 2002:a17:903:1d1:b0:14a:8f71:1f5d with SMTP id e17-20020a17090301d100b0014a8f711f5dmr6388918plh.69.1642816447605; Fri, 21 Jan 2022 17:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642816447; cv=none; d=google.com; s=arc-20160816; b=gbGP5p9anR6shO2+ZYdQvah26+sEka7VvhhjxOz0BYKieYsxdkrhbJNnsVBXgqPyht aFlTsCPrbKx1zBKDc5XZeNXgSQzZnIkV45QPLosCXDS+2V4MZzuSssN2M3jTEIjGu8st rlBXSaFG7SEyU7EfNDe4tfSRrTFYQuI0NJSEJxbuuI6HadzSZWaPoA/XNzaBW28v55Tx ENCv3EkY4+Pn4fOwdg3pS+CnWEvksE0Ol1YHScwLqbVlHBXwAjDAHYK8LFBy5k7kzmmC DtUZfT9qDxV3s5WcGZHUM78mA5CuswLAHxUFf+jO2MCVE5TzEOcMZ1Wg6edz8iAswrEg V1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dwS8YPtaKRJbZJ2QLv8fRhzLSj55VYU/pYMIVxqhzqA=; b=c2SkM6fAbd8a8kapDtikEC3eEB/rtv6OP7y8FBtTbV8nB66iADc6AWaoZozpyIXdeN 8emgWWEtdO7uOz+t47hwqDhZB67iyUGl1Iv62yp70NT/7q69OUJDjDeOkoy0tFdZlWkW fUCuQDCh75TWmgrsQS9swfJ+VB1b42m+TiQTmu+qwbZqsOkQicMbdzyLL1uKXZ/f/PxA d3fCkCpcdYIOfOdbyX+Sf30K1gysHJJYGZALAWd2e4taA7bQIOAB1eypxqV0m9Vpu1u/ s66JL+0J4YJCGk+nKGRGdk/INNlHpz8g+v2XUvbA/DnX3yfMVJTfpHf0e96y0YkuGujy MYXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="OOO3giZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i191si4855505pge.679.2022.01.21.17.53.56; Fri, 21 Jan 2022 17:54:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="OOO3giZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381581AbiAUPV7 (ORCPT + 99 others); Fri, 21 Jan 2022 10:21:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381538AbiAUPVe (ORCPT ); Fri, 21 Jan 2022 10:21:34 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69EB8C061747 for ; Fri, 21 Jan 2022 07:21:34 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: detlev) with ESMTPSA id C21511F46214 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642778493; bh=idCRqSfxdKKzhaecaARxomPwbXX0Gq6x7F6Y/PBqvN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OOO3giZ/gCqIS3Hjro+FfPBGrgmSdZIXGzE/77X1tp+kGba/aj7TGZBtUrMe1Plfl Ibz9GyZ0XPU8YKrTw/p51aXyNplsovxXm4raTrLs8exAIcd9g/rb8QzMYCZaG9eadr w53+sMNNgKUoIm5KCYQmh5xHuPw9WcNjJN2TDL5CIUWo1wYbveAC1KoZIXgJgn/CHq 1jqUMxS5ypdT0PaZATfSL4htEKWOjyoadC3QssrKhsboyhSYBaVS+U2abvcXR3kXdX 5PvNSzaIJ7P0aaYqWyvGthaNh0Hc7ZdP5IMOua+TeaTkxl/K6/ly78bXYi+09x/bd6 hEdV7tkJrQoHw== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Dave Stevenson , Liam Girdwood , Mark Brown Subject: [PATCH v2 8/9] regulator/rpi-panel-attiny: Don't read the LCD power status Date: Fri, 21 Jan 2022 10:20:55 -0500 Message-Id: <20220121152056.2044551-9-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121152056.2044551-1-detlev.casanova@collabora.com> References: <20220121152056.2044551-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Stevenson The I2C to the Atmel is very fussy, and locks up easily on Pi0-3 particularly on reads. The LCD power status is controlled solely by this driver, so rather than reading it back from the Atmel, use the cached status last set. Signed-off-by: Dave Stevenson --- drivers/regulator/rpi-panel-attiny-regulator.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c index 8090b9a485b5..8b80c0de1022 100644 --- a/drivers/regulator/rpi-panel-attiny-regulator.c +++ b/drivers/regulator/rpi-panel-attiny-regulator.c @@ -144,24 +144,8 @@ static int attiny_lcd_power_disable(struct regulator_dev *rdev) static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev) { struct attiny_lcd *state = rdev_get_drvdata(rdev); - unsigned int data; - int ret, i; - - mutex_lock(&state->lock); - - for (i = 0; i < 10; i++) { - ret = regmap_read(rdev->regmap, REG_PORTC, &data); - if (!ret) - break; - usleep_range(10000, 12000); - } - - mutex_unlock(&state->lock); - - if (ret < 0) - return ret; - return data & PC_RST_BRIDGE_N; + return state->port_states[REG_PORTC - REG_PORTA] & PC_RST_BRIDGE_N; } static const struct regulator_init_data attiny_regulator_default = { -- 2.34.1