From patchwork Tue Mar 26 18:07:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13604828 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 166CBCD11DF for ; Tue, 26 Mar 2024 18:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y4tNNOADDh1Nc+PFy+C6TOZQ8S4d4R6o8UCKnxi81w4=; b=XECnNIR4gJIyM2 pNxPdgzvynwVboaobtaNcrRQzdfVL9i3UYgaarxK/8JryFGaY+Ze3dc7XETsv4NdAIiy3SIKoB7Nl MmYfEubznnwgNOz1fjylWZql4cZN8TUyYHdsaNVtBDrmb2YNk9hRyGTlyoNaJoSxoqam50BbY3WDb OgUXpNIaAY87kPRkuGBx5M9R70XkD/LRaoyjlBrRpaGdDwoi6bKMQ54RdPQNilrD73ia3FA8CBTpx ps/UUqakBiWXsbaDE9lGv8YvKSDf/dpvAiY4In5/9HxDRQ6Pgt3u070k5+DlI7gPvr7rZyFGtR+I8 bb/Eo1XL7WwfPtvUZF2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpBH2-00000005syd-3kIP; Tue, 26 Mar 2024 18:11:48 +0000 Received: from mgamail.intel.com ([192.198.163.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpBG1-00000005sRD-2zuw for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 18:10:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711476645; x=1743012645; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jFzgo5+g95yyxQjjsoDzp1sVeyMA6hDbVV6LnWCwoqk=; b=DKMd62nhZN5OEzwNEk/r7b4YdaXSGzCIWqM+1txc9wXkNgHyWTKEI5HE 9nJO+YYAJq2qUZLKO5L7Qtl/AVZ02MbgdID3eWQ0B7Kg2x+RwF4Lh+XTw Ww/BeD15HQnwAJAXKm3L63AbAaquP4HNC/MRQNq2osOugruj2QRK+sOsE 83LEJ9rfFO3RzOnVO8XVmV6d9XyXPgSHqxdV0ZEheo54UmaFH+1ErOz9w 9V16q6dXL0NMck/0hTxjbao3GYQ/V07hFQvVDeGtIHPsb+c31Qo6UhtCB 8hQJSFBK2VqrdX2DTo1fh8+ZL6lqhe0wacjQl/U89USiaDAL2aY+vBbl6 w==; X-CSE-ConnectionGUID: nMGdC4V2S5+9fnrKJU7DEw== X-CSE-MsgGUID: PkmgrezeSP6C3Yfun7yqSw== X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="10325715" X-IronPort-AV: E=Sophos;i="6.07,156,1708416000"; d="scan'208";a="10325715" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2024 11:10:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="937072941" X-IronPort-AV: E=Sophos;i="6.07,156,1708416000"; d="scan'208";a="937072941" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 26 Mar 2024 11:10:38 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0FFB16AF; Tue, 26 Mar 2024 20:10:35 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v1 05/10] spi: pxa2xx: Skip SSP initialization if it's done elsewhere Date: Tue, 26 Mar 2024 20:07:55 +0200 Message-ID: <20240326181027.1418989-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240326181027.1418989-1-andriy.shevchenko@linux.intel.com> References: <20240326181027.1418989-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_111045_917591_CA7BF0A9 X-CRM114-Status: GOOD ( 14.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If SSP has been enumerated elsewhere, skip its initialization in pxa2xx_spi_init_pdata(). Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index e7072727c25c..b01a18c89b6b 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1355,6 +1355,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device *parent = dev->parent; enum pxa_ssp_type type = SSP_UNDEFINED; + struct ssp_device *ssp = NULL; const void *match; bool is_lpss_priv; int status; @@ -1372,6 +1373,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) return ERR_PTR(status); type = (enum pxa_ssp_type)value; + } else { + ssp = pxa_ssp_request(pdev->id, pdev->name); + if (ssp) + type = ssp->type; } /* Validate the SSP type correctness */ @@ -1394,6 +1399,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) pdata->enable_dma = true; pdata->dma_burst_size = 1; + /* If SSP has been already enumerated, use it */ + if (ssp) + return pdata; + status = pxa2xx_spi_init_ssp(pdev, &pdata->ssp, type); if (status) return ERR_PTR(status);