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 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=unavailable 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 F0E13C54E8D 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 D103E208DB for ; Mon, 11 May 2020 08:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729163AbgEKIan (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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Ruehl 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> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Chris Ruehl , Jack Lo Cc: Mark Brown , Heiko Stuebner , linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rockchip.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 --- 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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 626B1C47255 for ; Mon, 11 May 2020 08:31:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 26BDB20735 for ; Mon, 11 May 2020 08:31:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F9Yg5zOI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26BDB20735 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gtsys.com.hk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=YTKw1vhwz8CuOayws6mGsgeR2MZvUXpbECFwlA8Eyjc=; b=F9Yg5zOIK8kJCv C7G4y1y6gdy1yT8yJw4UBwQtClPLmAduWlOtumb2svaiQZzrrqdN097pedh7VTgeGGy282ygADVIJ 8iTVtt3alXN9xMTZ9JV6xQkxDMn5wGwdHqNh8bDB8PdlNJpmfmSPpeWlvELLnpvVVZ0NBaKlzwugS IWQJmtVs/Y8alr3vE2D0QAd4eXiYfCaTvT6mZdUwvL/PilXWyTF34V/03lYVMWCY+5l/gNy84PDQF leg1jaQoNU7V+ZSEZGNdy0ccEvxRmDgWUOYbfYXjSpnKjuzF4b2YmuWn+bAi1ZBMrrkc05s2IVwC2 jnbzp9RDuiD9sbsfLKMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY3q5-0008Ff-7B; Mon, 11 May 2020 08:31:05 +0000 Received: from [27.111.83.178] (helo=mail.gtsys.com.hk) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY3pn-00082W-5D; Mon, 11 May 2020 08:30:48 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200511_013047_354670_0B1DD665 X-CRM114-Status: UNSURE ( 6.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-rockchip@lists.infradead.org, Mark Brown , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel