From patchwork Fri Feb 25 17:23:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12760606 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 ED8AFC433F5 for ; Fri, 25 Feb 2022 17:26:45 +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=USSX/x91EJ3CLbbD9yCq8cxs4QYRF/JdyMcQsvxWWFU=; b=ZLkD12ljt7mqz/ bGTlOUIgrTPqMlwzc95cLvBdia8+r4eXQpJRfTVEeoXjv13CxLQS2W+k1dNdYaanaZkcHlRwhMcMl UDf5+c4B89cpshL3XEbzUj2RtGhDDdKLyr3THjpNtizC3Jhc9r5rRzxjNoMNXAOT51ihh8OAjOnjU Jr2VDgrRNsuG31pK1rGNXsJobOIjUs6yGvBqgMkyMvp0d+I9PhWuS4xGL4ZzetQaiQDhmK2vH50ju CjdA2aK2motei9h3M3AMpG6lEs9fKjlvq3BN4+xbinMf7BUehS97O3FyL1C2dWdTdps6yu3WKgAEh 7maMnGVwMmZ/+NCXAjsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNeLb-006Cuv-9P; Fri, 25 Feb 2022 17:25:39 +0000 Received: from mga12.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNeK9-006CNZ-RM for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 17:24:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645809849; x=1677345849; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q5ByLcewtILeNFeZF/m+uYsB2G/oXs3txUj2ZiVryFw=; b=UiYJvIrpf/OW6Ik5k/93onm8yFVTzCaeQMeBtpb1N6cOyNdqwxq33IJW ndRJtNmKpGdI/Mb1f8/sOLI/+bXQ8jU3Hj5nictjsrKSryB1zbLPWndTt elzkXC2VXqbR33U+3kGYAKPvc+sIDPjQo8jP3ZTB1SpjBzaFG/u0fZwVy DokFPWlN+dgR3byOnFyF1RPHxE0PyMAISrdOpnMsmkdUKRciGErK50/VP zMsvySCCE186asCrEp1zwdy5XZK61IWnvqacwVUSJOAsjibPntRrHdCb9 ybCVN4V19bk5ZViJkb6UOdwSQxw0aJ+dN/ipzZVn5O5IcWwDgxMvESbJn g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="232513156" X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="232513156" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 09:24:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="549342139" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 25 Feb 2022 09:24:04 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4465194; Fri, 25 Feb 2022 19:24:21 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Subject: [PATCH v1 02/11] spi: pxa2xx-pci: Refactor Quark X1000 to use ->setup() Date: Fri, 25 Feb 2022 19:23:41 +0200 Message-Id: <20220225172350.69797-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225172350.69797-1-andriy.shevchenko@linux.intel.com> References: <20220225172350.69797-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-20220225_092409_989672_7EC5E362 X-CRM114-Status: GOOD ( 12.61 ) 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 Refactor Quark X1000 handling code to use ->setup() instead of using the configuration data structure directly. It will allow to refactor further to avoid intermediate storage for the used configuration parameters. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx-pci.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index bd20379d9342..4d617ad72bca 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -167,6 +167,14 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) return 0; } +static int qrk_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) +{ + c->num_chipselect = 1; + c->max_clk_rate = 50000000; + + return 0; +} + static struct pxa_spi_info spi_info_configs[] = { [PORT_CE4100] = { .type = PXA25x_SSP, @@ -209,8 +217,7 @@ static struct pxa_spi_info spi_info_configs[] = { [PORT_QUARK_X1000] = { .type = QUARK_X1000_SSP, .port_id = -1, - .num_chipselect = 1, - .max_clk_rate = 50000000, + .setup = qrk_spi_setup, }, [PORT_LPT0] = { .type = LPSS_LPT_SSP,