From patchwork Fri Oct 21 19:00:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13015263 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 C73A7C433FE for ; Fri, 21 Oct 2022 19:01:20 +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: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:In-Reply-To:References: List-Owner; bh=mLO/QNNu8h6zUnIXQEshoQa4WZrWUSrIfvhkqB87cLY=; b=apttBmpgZ12Fvw BeLjWRp3sdtax9IYJsxL0MZ/SMAZ4KsWSrnh8z/bnZySlNXTLpWsxM96Dq9iczArK9DobqGCoaS7P 4ekomr1hKaZ2EoTfpPc9vBIHZRxNqquS90qR8rgJxRjQqLk5TOGaVENtzqytRXH3jmwm54LxjkQUX X0jgEzDxckUMwNTTWFkjflC2hOtG+ZPSfp4Oy9uzFL62CnfBUrZevCo1VZhweTOrXiomW4jPcJsxt TxCm/aZX09QkUAeSQtYvUbH0/IjMwr5RpGW/h7nj6C9gP/K5W4EkW4n9sHr775ptSCE0GvQ1pO1Rw EUfLF6C2vceJkM1HxI7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olxFg-009UEL-MJ; Fri, 21 Oct 2022 19:00:16 +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 1olxFd-009U8E-0L for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2022 19:00:14 +0000 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:mime-version: content-transfer-encoding; bh=/h+VrN160fOhMYJNJRAgTKgEfr4ireiMY5yjWF5ws8Q=; b=EPzxoZKybbSaEeR2qZP8evcyKEuVisMay82ZDj7DJD7eM2x8UKa2o6nJ wuqDiXqma7z0BWymDUbhmQjj8OfAQeFcX/1qNQe1urf2XqC+/u76Y4clg IJshHXxK9cCm9iZEYrOmKxngTXYKH72JkSz/AWwxsznhaGxlN5f7C0Qp/ sbSmS8XTCDfD4i+64wk0qpxO+Fd074SwXdvLLo14ZeHsmJSaIi5CUeUPE RCkObKfy+PFgJuZC12zWK+JQx1di/tkVYqAUEUv2Vvza9du8YOziOO5jG xz2twNWuZ8qa2H4bznKq8iGV8khUP6gWEwSaQHBfaiqVPsKYzxRTvPK1H g==; X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="369136841" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="369136841" 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="773171046" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="773171046" 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 BE58F107; 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 0/4] spi: pxa2xx: Pass the SSP type via device property Date: Fri, 21 Oct 2022 22:00:14 +0300 Message-Id: <20221021190018.63646-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221021_120013_112688_B0D7D6B3 X-CRM114-Status: GOOD ( 14.49 ) 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 Currently the SPI PXA2xx devices on Intel platforms can be instantiated via the following paths: 1) as ACPI LPSS device on Haswell, Bay Trail and Cherry Trail; 2) as ACPI LPSS device on the Sky Lake and newer; 3) as PCI LPSS device on Haswell, Bay Trail and Cherry Trail; 4) as PCI LPSS device on the Sky Lake and newer; 5) as PCI device via ID table. Each of these cases provides some platform related data differently, i.e.: 1) via drivers/acpi/acpi_lpss.c and drivers/spi/spi-pxa2xx.c 2) via drivers/mfd/intel-lpss-acpi.c 3) via drivers/spi/spi-pxa2xx-pci.c 4) via drivers/mfd/intel-lpss-pci.c and drivers/spi/spi-pxa2xx.c 5) via drivers/spi/spi-pxa2xx-pci.c This approach has two downsides: a) there is no data propagated in the case #2 because we can't have two or more drivers to match the same ACPI ID and hence some cases are still not supported (Sky Lake and newer ACPI enabled LPSS); b) the data is duplicated over two drivers in the cases #1 & #4 and, besides to be a bloatware, it is error prone (e.g. Lakefield has a wrong data right now due to missed PCI entry in the spi-pxa2xx.c). This series fixes the downsides, and enables previously unsupported cases. On top of that it has a couple of cleanups (patches 4 and 5). Changelog v5: - added a patch to validate the SSP type - reworked LPSS detection code to narrow its scope (Mark) - dropped applied patches Changelog v4: - apply the property only for known MFD enumerated devices (Mark) Changelog v3: - added tags to patches 4 & 5 (Jonathan) - massaged cover letter Changelog v2: - added cover letter (Mark) - dropped applied patch Andy Shevchenko (4): spi: pxa2xx: Validate the correctness of the SSP type spi: pxa2xx: Respect Intel SSP type given by a property spi: pxa2xx: Remove no more needed PCI ID table spi: pxa2xx: Move OF and ACPI ID tables closer to their user drivers/spi/spi-pxa2xx.c | 171 ++++++++----------------------------- include/linux/pxa2xx_ssp.h | 1 + 2 files changed, 37 insertions(+), 135 deletions(-)