From patchwork Mon May 11 08:30:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Ruehl X-Patchwork-Id: 214659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB1A2C47255 for ; Mon, 11 May 2020 08:30:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAF0A2080C for ; Mon, 11 May 2020 08:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728772AbgEKIan (ORCPT ); Mon, 11 May 2020 04:30:43 -0400 Received: from server-x.ipv4.hkg02.ds.network ([27.111.83.178]:58604 "EHLO mail.gtsys.com.hk" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1728702AbgEKIan (ORCPT ); Mon, 11 May 2020 04:30:43 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.gtsys.com.hk (Postfix) with ESMTP id C7A462002518; Mon, 11 May 2020 16:30:40 +0800 (HKT) X-Virus-Scanned: Debian amavisd-new at gtsys.com.hk Received: from mail.gtsys.com.hk ([127.0.0.1]) by localhost (mail.gtsys.com.hk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AuE0Dfh_okQ8; Mon, 11 May 2020 16:30:40 +0800 (HKT) Received: from s01.gtsys.com.hk (unknown [10.128.4.2]) by mail.gtsys.com.hk (Postfix) with ESMTP id A2E5320020CB; Mon, 11 May 2020 16:30:40 +0800 (HKT) Received: from armhf2.gtsys.com.hk (unknown [10.128.4.15]) by s01.gtsys.com.hk (Postfix) with ESMTP id 96943C01F94; Mon, 11 May 2020 16:30:40 +0800 (HKT) Received: by armhf2.gtsys.com.hk (Postfix, from userid 1000) id 3F6272001DE; Mon, 11 May 2020 16:30:40 +0800 (HKT) From: Chris Ruehl To: Chris Ruehl , Jack Lo Cc: Mark Brown , Heiko Stuebner , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 0/3] spi: spi-rockchip spi slave mode Date: Mon, 11 May 2020 16:30:19 +0800 Message-Id: <20200511083022.23678-1-chris.ruehl@gtsys.com.hk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org The spi-rockchip driver does not implement spi slave mode, but the register map have a corresponding flag. An example implementation found here: https://dev.t-firefly.com/thread-101485-1-1.html This patchset clean the compatiblity names and add support slave mode. We need the slave mode for our project, but the PCBA is not yet available in consequence the code in the patch isn't tested yet but need your review. Patch 1/3 Cleanup, move from the compatibily layer struct spi_master over to struct spi_controller, and rename the related function calls. Patch 2/3 Add support for spi slave mode and support function Patch 3/3 Use OF property num-cs and enable support for cs_gpiods IMHO its wrong, that the num_chipselect is set fixed to the amount of native chip-select lines. SPI0 which has two native lines, while the others SPIs one native cs line only. Set max_native_cs in the controller struct with ROCKCHIP_SPI_MAX_CS_NUM seems the correct way to do and let num-cs the OF / dts config set the CS count for the boards. Patch against next-20200508 Thanks for review! Happy hacking Chris Signed-off-by: Chris Ruehl