From patchwork Thu Oct 20 19:44:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13013956 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 2473FC4332F for ; Thu, 20 Oct 2022 19:46:09 +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=byJ9BnDx2eftdhhZ2NADOpD+hR7e7zSzkaSACNttXxM=; b=DehpV0WVJsXvsY t7zrPqaVbdliAmLIbziYF7YaQI7ZPdN3iXMLBNCCf2GDGbKspzBGCcv+sewaIdyZ9wvbxYrA6srUc +cy3+RN1D/sR8lfU+LPZvxVbA8r7e1GQtSHQ4lwTVzeCjtLYLCDSGTUH15TN1FZyZs1gCZf7Hi6uz p6N1Df6s27GcC39McU6fPSEwCyXs7glyWTyTTGA0GQOH0P4ilXp7+Gtjeqw6c/2H6tjvfg16FDfOX 6T97WrKbHAzaH1QmLLNN270XtxnYd+yUb5Ae4UZSE3+lZnyEntJD7D4DV0RXHIBdj4AxAGUaLPTs8 THQagn8Jww4blypf38VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olbTU-001TSl-2l; Thu, 20 Oct 2022 19:45:04 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olbTJ-001TM0-Kg for linux-arm-kernel@lists.infradead.org; Thu, 20 Oct 2022 19:44:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666295093; x=1697831093; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jRtLRvDs43iHgGkeKwqBjox9tFRe2xXnZgo9MxkWuFY=; b=AkZCew9djsoz/jtGR34mJeo9BN6AbBNp3x7HRXXD/DutC+M06VUXJ/LN n48yxRjdAyNoEbUm7rAfOs48B/qojWW7AVR/n00eXSnsLeLcboCIS/FLj H65lj+AHp0i/ZbcPBRegPieR7K3pJOoK+wqBqC34NVcueTXp0OI1OlDOz 34fvT+4qg2cZZAIHKqiwB6IKTzRwwwYIe980+5/s7cVUHNREWnJjcfieD F+MMs1PvUoiglwJIVkvl+EkCIFgsEvttp5rzFvFXFZrN6PNCMz9Y7iggP de0EIFHLYt31OZfi2/aW36ZlAW2rMsP4yiQXWYK1DkOedcJoPzIW03clT Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="307918655" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="307918655" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:44:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="875210362" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="875210362" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Oct 2022 12:44:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E5740D0; Thu, 20 Oct 2022 22:45:03 +0300 (EEST) 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 v4 1/5] spi: pxa2xx: Respect Intel SSP type given by a property Date: Thu, 20 Oct 2022 22:44:56 +0300 Message-Id: <20221020194500.10225-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> References: <20221020194500.10225-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-20221020_124453_744951_D2BB8B34 X-CRM114-Status: GOOD ( 13.51 ) 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 Allow to set the Intel SSP type by reading the property. Only apply this to the known MFD enumerated devices. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 12 ++++++++++++ include/linux/pxa2xx_ssp.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 03ed6d4a14cd..f3ba1b0588fb 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1460,17 +1460,29 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct resource *res; struct pci_dev *pcidev = dev_is_pci(parent) ? to_pci_dev(parent) : NULL; const struct pci_device_id *pcidev_id = NULL; + u32 value = SSP_UNDEFINED; enum pxa_ssp_type type; + bool mfd_enumerated; const void *match; int status; u64 uid; + /* For MFD enumerated devices always ask for a property */ + mfd_enumerated = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv"); + if (mfd_enumerated) { + status = device_property_read_u32(dev, "intel,spi-pxa2xx-type", &value); + if (status) + return ERR_PTR(status); + } + if (pcidev) pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); match = device_get_match_data(&pdev->dev); if (match) type = (enum pxa_ssp_type)match; + else if (value > SSP_UNDEFINED && value < SSP_MAX) + type = (enum pxa_ssp_type)value; else if (pcidev_id) type = (enum pxa_ssp_type)pcidev_id->driver_data; else diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index a3fec2de512f..cd1973e6ac4b 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h @@ -229,6 +229,7 @@ enum pxa_ssp_type { LPSS_SPT_SSP, LPSS_BXT_SSP, LPSS_CNL_SSP, + SSP_MAX }; struct ssp_device {