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 639A8C433FE for ; Fri, 21 Oct 2022 19:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiJUTAX (ORCPT ); Fri, 21 Oct 2022 15:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiJUTAV (ORCPT ); Fri, 21 Oct 2022 15:00:21 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B27B24D8BC; Fri, 21 Oct 2022 12:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666378812; x=1697914812; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6KHP9T1zHMb4SNG4errxN0lomDv65adiOY/SYXWbHjM=; b=bmtdcDUi26px8GH6OPmATbLkvZsVyOE3JuGUfDtQPxHRNEXIqxaxTvfz INLPWFJWGQRJ1HQQgOvjLHf0LCEn+MKNYBBiqub4S//XIdg0YE/ISAe1W 0rroUtXXJzXVX/S32VRuUsQVjsPRJUvJsYKH19YHl/7bitEKoWB3GpaVX otBprZ9zEDjSvwYJBPtojtk0PAHwChrECpuAcagWFBS/+TgC3VogOcwda TdaXLjezJTN457ZRGuZzGe8zAEgWEcZNsWZjex9YDL6ZfHLgW2iPW+zt8 hWjw6/Ra67vCGVvTDRkWzQa76z94l5egLVFPTjO4MxMYPxJpqJLoNwdGw w==; X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="333658297" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="333658297" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 12:00:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="773171048" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="773171048" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 21 Oct 2022 12:00:01 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D6FBA291; Fri, 21 Oct 2022 22:00:22 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH v5 2/4] spi: pxa2xx: Respect Intel SSP type given by a property Date: Fri, 21 Oct 2022 22:00:16 +0300 Message-Id: <20221021190018.63646-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021190018.63646-1-andriy.shevchenko@linux.intel.com> References: <20221021190018.63646-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Allow to set the Intel SSP type by reading the property. Only apply this to the known MFD enumerated LPSS devices. The check is done by the looking for the specifically named IO memory resource provided by upper layer. This won't be an issue in the future because we strictly prioritize the order in which we are looking for the SSP type in the code. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 93be7e8ef884..5527bcc5c729 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1462,9 +1462,12 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) const struct pci_device_id *pcidev_id = NULL; enum pxa_ssp_type type = SSP_UNDEFINED; const void *match; + bool is_lpss_priv; int status; u64 uid; + is_lpss_priv = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv"); + if (pcidev) pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); @@ -1473,6 +1476,15 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) type = (enum pxa_ssp_type)match; else if (pcidev_id) type = (enum pxa_ssp_type)pcidev_id->driver_data; + else if (is_lpss_priv) { + u32 value; + + status = device_property_read_u32(dev, "intel,spi-pxa2xx-type", &value); + if (status) + return ERR_PTR(status); + + type = (enum pxa_ssp_type)value; + } /* Validate the SSP type correctness */ if (!(type > SSP_UNDEFINED && type < SSP_MAX)) -- 2.35.1 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 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 236E2C3A59D for ; Fri, 21 Oct 2022 19:01:34 +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=oTMcOCx8Co1ahADlehrUqjjZjgEiSz4bgfbH62Adcvo=; b=Tj2N/QV9MtUorG 5RMuoSOniPPtjFPmT2T1GzZxbIiwZBvNk82H3jU+TjFwE4pQYBlA1pohiYHj4g3x4DTQPs+HrKRw0 SBN25FWGsObUHxGKkJDzNs01hbmFqvs3OA4+ivdH/Az8sPvnMxUOAkz7gXdceLSjvG+MlukBkAsi/ T/L7JdXr+JFi5UFm3PE2de4G8EL9Ks5z2dfwi9+wV/oC19h1DM3dGE95LfYclcuQtqmbdSfNqKa9L cDvKHJQt16ZF/KXTwnaOm0/rbscM1h7+3iTfJa3RI1YK/JnVZRYVUlIqV1k8wVP7b8b+GvOaX0e2E ViXox1dkHELffRIXZy9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olxG2-009UNV-DF; Fri, 21 Oct 2022 19:00:38 +0000 Received: from mga06b.intel.com ([134.134.136.31] helo=mga06.intel.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olxFe-009U8E-ES for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2022 19:00:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666378814; x=1697914814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6KHP9T1zHMb4SNG4errxN0lomDv65adiOY/SYXWbHjM=; b=BncI755FbWKvG2RleYME0uz/EQ8CeOlQFiNnoPsOC64gT9+n0qyat49b QTgkpEkUFx2YSFlLjHeLyUE9U/Wn+sRGDeLga4GGnKtP9LjsSsjAWv3Fs jCjkJTRffXFY5lYEsp+F7+HXt30ZZhkA30GLPCXPe6cWxvBjoY+nla33f 85zzPTzu6umlMjA4GeUXw1bC8zeRUPankXvqYzu9IBu3ObG8nHznm9SlD lroJEBYlbGeoNFWH8NWIwEgcVoPGpLt27Nbzows6+ALx6EcIP2IrVNDqG Vtpqvuz5fstm+5LKOSf2Of4YaQIbebxojvZ7qm4C8k0LFXAGK1IyXobps Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="369136843" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="369136843" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 12:00:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="773171048" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="773171048" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 21 Oct 2022 12:00:01 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D6FBA291; Fri, 21 Oct 2022 22:00:22 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH v5 2/4] spi: pxa2xx: Respect Intel SSP type given by a property Date: Fri, 21 Oct 2022 22:00:16 +0300 Message-Id: <20221021190018.63646-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021190018.63646-1-andriy.shevchenko@linux.intel.com> References: <20221021190018.63646-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-20221021_120014_542102_557BF90F X-CRM114-Status: GOOD ( 15.31 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow to set the Intel SSP type by reading the property. Only apply this to the known MFD enumerated LPSS devices. The check is done by the looking for the specifically named IO memory resource provided by upper layer. This won't be an issue in the future because we strictly prioritize the order in which we are looking for the SSP type in the code. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 93be7e8ef884..5527bcc5c729 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1462,9 +1462,12 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) const struct pci_device_id *pcidev_id = NULL; enum pxa_ssp_type type = SSP_UNDEFINED; const void *match; + bool is_lpss_priv; int status; u64 uid; + is_lpss_priv = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv"); + if (pcidev) pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); @@ -1473,6 +1476,15 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) type = (enum pxa_ssp_type)match; else if (pcidev_id) type = (enum pxa_ssp_type)pcidev_id->driver_data; + else if (is_lpss_priv) { + u32 value; + + status = device_property_read_u32(dev, "intel,spi-pxa2xx-type", &value); + if (status) + return ERR_PTR(status); + + type = (enum pxa_ssp_type)value; + } /* Validate the SSP type correctness */ if (!(type > SSP_UNDEFINED && type < SSP_MAX)) -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel