Received: by 2002:a05:7208:1509:b0:82:bbfa:f723 with SMTP id o9csp767978rbf; Wed, 24 Apr 2024 19:11:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWPfxT71r1haS4l5j9VF1K84ZGyJ9glNjNUxK0sF6Oyepc7AwCvI7bE3246yevH3942ByNgw6UwGRiEO/cE8VkQ71JoLsjDbsYGZoPjA== X-Google-Smtp-Source: AGHT+IEmBfFYPwrWDXLyKbGYyqKyr15ZQQTiRE/a9iqmN7KIhC4vhMFvKSmAsDwMrf2up0gDUXRh X-Received: by 2002:a2e:8687:0:b0:2db:98d0:fd1b with SMTP id l7-20020a2e8687000000b002db98d0fd1bmr3538124lji.46.1714011115881; Wed, 24 Apr 2024 19:11:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714011115; cv=pass; d=google.com; s=arc-20160816; b=yFfUlhXitM1gFNHx2YVCrg5wvZx0jbcrKf5siMxSD3Mc1CHdGKv5l8Q39lYFwfxY2A 29uTjerSTy6x/5Wom6JeKPsUtx6WIMkbC75Ie9PDGA1qU4VSdRYOG4WstiOtHq3iMUmB 0NiTTSNJU8vemZDg3qaNRguAIEw4MDLF5/JR7wOIvrXqtvIeNl40ePA9/Z0VGyUyQyju zX4b5llYg9IxFvnGvwCqgCntMcs13QY1HrvMjcYqWZkyXnN7gqS1cFxZHvoSXmcZkRAA 24wrfOVRV72EI+tMKCpFhK9LeayAnLiOERdAPRLW5Co19Sg99dQWzoS4rRqAiRq2PzlE 4mEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=EZVXgbN1wH/AqYBH20dS4hDQxOscPBy6Iif8n7vgDBM=; fh=SmNAsmYl4x7ci76Aq1FpVq8xcTpieEFldV2TPGMwNDk=; b=guqXAUCaYSRENeRMbkClVHgtjNqyTvJ+FM2kINXxkkJQ5uIPw1Vzhev2PuLJGnBKgY VTK/Tx7FQ+aUkglpGW9mEagDqSf/XXOL/qMTKDPJtgkDj24HRW7uiUCszswWjEA9Vxni VHXKtxDKKPTKwy2zTn2C5gIFVHbK4nSAjPSsecKvmSvmANV0Z6U4Xl+L3XN0VneiA3uz dVYzYS4zJkvjU+mpTZXJBVSEmOccsfdfM3rFCHusFKZoFidMWI5bZp7GZt/s3jazoRGe Mg3jdbS8Gdm70sQ8Bfb3SnJnXfxVeBho+5N4zKeTl1gcEyDseBJCGF61dPXaS8bu5O7y WC7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@metafoo.de header.s=default2002 header.b=jCaoz1Ds; arc=pass (i=1 spf=pass spfdomain=metafoo.de dkim=pass dkdomain=metafoo.de dmarc=pass fromdomain=metafoo.de); spf=pass (google.com: domain of linux-kernel+bounces-157929-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a12-20020a50c30c000000b0056e0de11f92si9129334edb.188.2024.04.24.19.11.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 19:11:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157929-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@metafoo.de header.s=default2002 header.b=jCaoz1Ds; arc=pass (i=1 spf=pass spfdomain=metafoo.de dkim=pass dkdomain=metafoo.de dmarc=pass fromdomain=metafoo.de); spf=pass (google.com: domain of linux-kernel+bounces-157929-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 97F6F1F23EA1 for ; Thu, 25 Apr 2024 02:11:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 592F8125A9; Thu, 25 Apr 2024 02:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=metafoo.de header.i=@metafoo.de header.b="jCaoz1Ds" Received: from www381.your-server.de (www381.your-server.de [78.46.137.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8996FFBF0; Thu, 25 Apr 2024 02:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.46.137.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714011101; cv=none; b=N8caMH1oiIyc2Ngxy6a0xLToQaYBeLV7eOXTmSOZGwZ4o1psn3gpax0wGGRXlRdylFnOQEtqDTyR49w27YMweFK+vqiIETsRijgy0jkxr3QqC3p1veR5bNxT2eA3trOX2ZdaZY7VtrOZkYKb3HP1Kln2Sw0XM0PjqE0eXRWiEwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714011101; c=relaxed/simple; bh=N2fQLR37PTUiko07ZkLTePJE+4Y6KWX362T/pv/F0QY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MLctJZyKIs9GXCMsKaXZL1k7LYFLxi1S8yB8KDrQTbJFgIxnyIAEVqoB5w6N1Vk+ck4LcK457d8+pVI9lKvFPGD+bSsNu49hTY5cFi6e2XdV8Jis2+rx/xVfCrEbyY8MIHeymC2kFzmFbaCHy8OubBtMxAVL/CWQTg3ok3GGmdQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=metafoo.de; spf=pass smtp.mailfrom=metafoo.de; dkim=pass (2048-bit key) header.d=metafoo.de header.i=@metafoo.de header.b=jCaoz1Ds; arc=none smtp.client-ip=78.46.137.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=metafoo.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=metafoo.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=EZVXgbN1wH/AqYBH20dS4hDQxOscPBy6Iif8n7vgDBM=; b=jCaoz1DsjQls5AriAYHHTjG5DR yCC8rIAC9GBxC5Uh7e4FoaV3NcrNzw1LMCRPyIFJBblebL3+ws3ENLx/lTkB3Zt5htSpeck7ti1eg mG2xNuSF95784vCCThpi4+I/kOcLatjnruTZOPWdzv6YMITeILxmPMQdbtoH7HUpQ2KIlh/2CawRy IuP/iqq6OsCwUKHm47eJbO/FwcD6JVkW7GX3DwW9mDHp1PjesE3DpwYjAPqsKPWz2SgdnV6iyaG9R jBbt3yJJAJoykU892umrmkob0UOcO2hzQkqpIIX9OuhsZn0xi/Z0VRIaMEk5AJdbk4W0u3S7pgyrT tPCzislg==; Received: from sslproxy07.your-server.de ([78.47.199.104]) by www381.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzoJS-000CGV-MC; Thu, 25 Apr 2024 03:54:14 +0200 Received: from [136.25.87.181] (helo=[192.168.86.26]) by sslproxy07.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rzoJS-0008R9-0N; Thu, 25 Apr 2024 03:54:14 +0200 Message-ID: Date: Wed, 24 Apr 2024 18:54:10 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/2] spi: spi-cadence: Add optional reset control support To: Ji Sheng Teoh , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Michal Simek Cc: Ley Foon Tan , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Eng Lee Teh References: <20240424051317.2084059-1-jisheng.teoh@starfivetech.com> <20240424051317.2084059-2-jisheng.teoh@starfivetech.com> Content-Language: en-US From: Lars-Peter Clausen In-Reply-To: <20240424051317.2084059-2-jisheng.teoh@starfivetech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.10/27255/Wed Apr 24 10:26:21 2024) On 4/23/24 22:13, Ji Sheng Teoh wrote: > Add optional reset control support for spi-cadence to properly bring > the SPI device into an operating condition. > > Signed-off-by: Eng Lee Teh > Signed-off-by: Ley Foon Tan > Signed-off-by: Ji Sheng Teoh > --- > drivers/spi/spi-cadence.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c > index e5140532071d..41f2f51d39e4 100644 > --- a/drivers/spi/spi-cadence.c > +++ b/drivers/spi/spi-cadence.c > @@ -111,6 +111,7 @@ > * @dev_busy: Device busy flag > * @is_decoded_cs: Flag for decoder property set or not > * @tx_fifo_depth: Depth of the TX FIFO > + * @rstc: Optional reset control for SPI controller > */ > struct cdns_spi { > void __iomem *regs; > @@ -125,6 +126,7 @@ struct cdns_spi { > u8 dev_busy; > u32 is_decoded_cs; > unsigned int tx_fifo_depth; > + struct reset_control *rstc; > }; > > /* Macros for the SPI controller read/write */ > @@ -588,6 +590,16 @@ static int cdns_spi_probe(struct platform_device *pdev) > goto remove_ctlr; > } > > + xspi->rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); The cadence SPI core has 3 different resets signals. Maybe use a name for the reset to make it clear which reset this is referring to. > + if (IS_ERR(xspi->rstc)) { > + ret = PTR_ERR(xspi->rstc); > + dev_err(&pdev->dev, "Cannot get SPI reset.\n"); > + goto remove_ctlr; > + } > + > + reset_control_assert(xspi->rstc); > + reset_control_deassert(xspi->rstc); > + > if (!spi_controller_is_target(ctlr)) { > xspi->ref_clk = devm_clk_get_enabled(&pdev->dev, "ref_clk"); > if (IS_ERR(xspi->ref_clk)) {