From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD9BEC4332F for ; Mon, 28 Nov 2022 17:50:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233889AbiK1RuE (ORCPT ); Mon, 28 Nov 2022 12:50:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233646AbiK1Rq5 (ORCPT ); Mon, 28 Nov 2022 12:46:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 408C32D75E; Mon, 28 Nov 2022 09:41:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D235E612E9; Mon, 28 Nov 2022 17:41:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D430C433C1; Mon, 28 Nov 2022 17:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669657304; bh=I5mzg9fFy1bW72TyvTZKG/bnL367pM9JALW3VqNVQrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aLr1GB5UJxoZE2fdhaXHdmaVxQcaJKJwMe9m2HPHjTcPL2kImBVakzGhqCgfxlnvx CeaDYKpNxleCTWwI/O7d57nbqu1x0RtHaDzcemeWyDciOycif9Xf65uzBnNdnzKH6B EtTee2pmUvelVbRylBeWihAxHuizAd/AKRyHybJK4M2kU3iQPWK1bdcRBa7hjVzYeh koud8SRB6Y1zpXvpZXpqfDcJNYM6kKWWThaB/5oMuhSbaagDUIAUzVKixfD/OYi9FR Ye/MXKquRpYi9DH31ODVF0LFR/FbKEVrwNG9UVQ29+DS1QEIRkwQzUbORXkAJtgs3l jVtQ2V/XJER5g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konrad Dybcio , Mark Brown , Sasha Levin , support.opensource@diasemi.com, lgirdwood@gmail.com Subject: [PATCH AUTOSEL 5.10 11/19] regulator: slg51000: Wait after asserting CS pin Date: Mon, 28 Nov 2022 12:41:11 -0500 Message-Id: <20221128174120.1442235-11-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221128174120.1442235-1-sashal@kernel.org> References: <20221128174120.1442235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Konrad Dybcio [ Upstream commit 0b24dfa587c6cc7484cfb170da5c7dd73451f670 ] Sony's downstream driver [1], among some other changes, adds a seemingly random 10ms usleep_range, which turned out to be necessary for the hardware to function properly on at least Sony Xperia 1 IV. Without this, I2C transactions with the SLG51000 straight up fail. Relax (10-10ms -> 10-11ms) and add the aforementioned sleep to make sure the hardware has some time to wake up. (nagara-2.0.0-mlc/vendor/semc/hardware/camera-kernel-module/) [1] https://developer.sony.com/file/download/open-source-archive-for-64-0-m-4-29/ Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20221118131035.54874-1-konrad.dybcio@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/slg51000-regulator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c index 75a941fb3c2b..1b2eee95ad3f 100644 --- a/drivers/regulator/slg51000-regulator.c +++ b/drivers/regulator/slg51000-regulator.c @@ -457,6 +457,8 @@ static int slg51000_i2c_probe(struct i2c_client *client) chip->cs_gpiod = cs_gpiod; } + usleep_range(10000, 11000); + i2c_set_clientdata(client, chip); chip->chip_irq = client->irq; chip->dev = dev; -- 2.35.1