From patchwork Sat Dec 15 23:38:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 153937 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp953060ljp; Sat, 15 Dec 2018 15:40:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WdODrxOuXxKIyxYmwgWRbKYuA/3OnTMcwck0BfO1P/Rr/TG0NuJr4jd2pAnMGwnNiU/EWQ X-Received: by 2002:a62:dbc2:: with SMTP id f185mr7872060pfg.235.1544917244367; Sat, 15 Dec 2018 15:40:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544917244; cv=none; d=google.com; s=arc-20160816; b=SHhr8kAp2LKA5fcjmK5tRd7C8KHsXPLnn4s28qNaQWrAu++4fNSPwEdXaPNL8UP69a FVNbjS16LnVihG9vwy3p2esclAkHdZXiz4ActZDqiiyxGenaqZVYIXAN38WCLZgy27Ix LodN5zeGbNvih2XW/mF3sWQBht9weFwcsaiSu7D7VQO2Lu3M6puwZSp23Tr7R+jCb6JS HRm9Z9zpt45/6r+WCaUiwS1Z13jKG/Xc1Jj6vFtXp01PKrRE+gLi9+rUry2rIFvxub3j H0vVzIYNUOdLXl7ioiwPGhMFO8Gel5ZIDK7yg79mbM6BKxaLJP9xhcxA0jxsWh9/BxaI gbnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QJ2cGH+GnLlSNOpAL5sCyQ2Yjefv7ABUW6sqYcQUzH8=; b=eoHtap+bNuSOP0PJ4DTG/fi9p8YWAvR2TiQY1Up3iUcfh8euz7NHMEjZFeuOVcoQNA WHWTNLvuKjlgrAwArBQvDjQA2Uy7wDLNGl0gT4WMpwZtGMczoqQzds/QP4q8OHTfVoY9 +TmPOYEjdfbFQIrRMCzO9172vwKoxWWFfKTiGqhnyhb1lwQObJ6nau1HPrX2RPnH3Ska LaqxLC272FbZn18U29v+XH+xm+tK8DguMg/jvB1iSrmGV4KYJ7tq4LuUeQx6jYMXXnst tRlogXVwrNvJhrr9gJwf2ZsJ+Wz1cN7iGu79TVV3S8bBLjfEac4uKPJ6W0bWUTTnbm9X 96qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AuS56J6o; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si7169685plq.336.2018.12.15.15.40.43; Sat, 15 Dec 2018 15:40:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AuS56J6o; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727227AbeLOXkm (ORCPT + 1 other); Sat, 15 Dec 2018 18:40:42 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41111 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbeLOXkm (ORCPT ); Sat, 15 Dec 2018 18:40:42 -0500 Received: by mail-lj1-f196.google.com with SMTP id k15-v6so7944933ljc.8 for ; Sat, 15 Dec 2018 15:40:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QJ2cGH+GnLlSNOpAL5sCyQ2Yjefv7ABUW6sqYcQUzH8=; b=AuS56J6oyBUzc7vnazn2IAocbe2mm5ATMdGI8XNearaZaJxv+irnnAuElBUtwaHPvw feBtCxMS43B5fscTPmI8MspTWkFgUNfOKd+WmYGsAGt7vleVA+CKKaD/LUqbPguwu/KF PvcBhTVh2JjXh+pOVvBaJEIlkLna3iHyvleJ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QJ2cGH+GnLlSNOpAL5sCyQ2Yjefv7ABUW6sqYcQUzH8=; b=VA0pscpv/5z3xXJrQEclIiGO3+SxtIw6e6o6kAXvDxzYw4uVJCrwu2Qy69JOawZVCE c4F/4b0nnDuzeE18rD1C7aoJUu11ls+r7tFS25QEa4jnoaY9vCvOXfY3DjdQvFN4xtSK yvje0w6D7MfMi8urqglxpd7zmchesVw2x8cjHgHV4dvGjz2uBkQTILpgvWW2oMH1i1Ol IfqAV5jP3Pb4g8X1xejPKNvX/gpZbF9fXEj/ydgYONIHG57BwQKznSOI2V6juOUoNTVl UA5y2DsqWlk0ds3MIngx+YFKrOW30gqctAs3E1YLgiCi+pN/HRGuFI2AEI25OCHq7o9b r1pQ== X-Gm-Message-State: AA+aEWbCaVs7LQji/mEHjNZkwnlvxV/H0ukW0inJ/bZT3KKBjN02rPP9 8eNNsTXO4HaLs40vrvTifwoScQ== X-Received: by 2002:a2e:6f11:: with SMTP id k17-v6mr4446444ljc.94.1544917239903; Sat, 15 Dec 2018 15:40:39 -0800 (PST) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id v19sm1709880lfe.69.2018.12.15.15.40.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Dec 2018 15:40:38 -0800 (PST) From: Linus Walleij To: Mark Brown , linux-spi@vger.kernel.org Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski , linuxarm@huawei.com, Linus Walleij Subject: [PATCH 0/7 v1] SPI CS using GPIO descriptors Date: Sun, 16 Dec 2018 00:38:16 +0100 Message-Id: <20181215233823.1042-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This is a first version of trying to pull GPIO descriptor handling of SPI chip selects into the SPI core. The core grows a bit, bit handles descriptors in addition to the already handled DT and static GPIO lines, and then I start converting over some drivers to show the utility of pulling this into the core. There are *many* drivers to convert. This should also cover the ACPI usecase by way of the completely generic GPIO descriptor handling code that simply picks the GPIO "cs" descriptors associated with the device. Linus Walleij (7): spi: Optionally use GPIO descriptors for CS GPIOs spi: ath79: Convert to use CS GPIO descriptors spi: atmel: Convert to use CS GPIO descriptors spi: cadence: Convert to use CS GPIO descriptors spi: clps711x: Convert to use CS GPIO descriptors spi: davinci: Convert to use CS GPIO descriptors spi: dw: Convert to use CS GPIO descriptors drivers/spi/spi-ath79.c | 42 +++++---------- drivers/spi/spi-atmel.c | 93 ++++++++++---------------------- drivers/spi/spi-cadence.c | 67 +---------------------- drivers/spi/spi-clps711x.c | 23 +------- drivers/spi/spi-davinci.c | 53 +++++-------------- drivers/spi/spi-dw-mmio.c | 22 -------- drivers/spi/spi-dw.c | 9 +--- drivers/spi/spi.c | 105 +++++++++++++++++++++++++++++++++---- include/linux/spi/spi.h | 23 ++++++-- 9 files changed, 173 insertions(+), 264 deletions(-) -- 2.19.2 Tested-by: Jay Fang Reviewed-by: Alexandre Belloni