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=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 67DB1C38A2A for ; Fri, 8 May 2020 08:46:31 +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 3AEB5207DD for ; Fri, 8 May 2020 08:46:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZT0kzqLe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AEB5207DD 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=RNAGPzFZMpsyyy/SBG5ZBBRxKOzt5FDLcW01iyPj1VA=; b=ZT0kzqLeCOPEMD WRcvhxJRZyumXdrVHn+k0gqPH8urhuNaVb3posW0l1qXpFH4qGrm5i0582x7J+iGNdV9M4UlOmkHL v+lj6MEnXuNEuVHqu7eZ1zfkN0bBQC60juYRIzxjIWWuk6Cay1WrRVJx9gSPh1IwcbX7wBJKT44P9 /uqx613iKgur3P3871lHOIIR2JGdvXdsdRyawvaOJrkrAlhJTDKRP3RCzzoPH+KG1t1RtNS7akaVG /eUC9pkd96Lim+kpXnw8vLUow3H5W88Ha1rzVzXXQ1ypmonVKJtEc2+f2DnADRN+W/OaJibI4F46S 49XgTWFYI0GH3h89SSFQ==; 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 1jWyeM-0000Gp-MG; Fri, 08 May 2020 08:46:30 +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 1jWyeJ-0008Uc-O7; Fri, 08 May 2020 08:46:29 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.gtsys.com.hk (Postfix) with ESMTP id 8BAF520024AB; Fri, 8 May 2020 16:38:34 +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 LeJQaVGZ0PTG; Fri, 8 May 2020 16:38:34 +0800 (HKT) Received: from s01.gtsys.com.hk (unknown [10.128.4.2]) by mail.gtsys.com.hk (Postfix) with ESMTP id 6A8CC20020CB; Fri, 8 May 2020 16:38:34 +0800 (HKT) Received: from armhf2.gtsys.com.hk (unknown [10.128.4.15]) by s01.gtsys.com.hk (Postfix) with ESMTP id 5D4DBC019F9; Fri, 8 May 2020 16:38:34 +0800 (HKT) Received: by armhf2.gtsys.com.hk (Postfix, from userid 1000) id 385EB201641; Fri, 8 May 2020 16:38:34 +0800 (HKT) From: Chris Ruehl To: Chris Ruehl , Jack Lo Subject: [PATCH v0] spi: spi-rockchip spi slave mode Date: Fri, 8 May 2020 16:37:28 +0800 Message-Id: <20200508083729.5560-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-20200508_014627_946800_486EACB1 X-CRM114-Status: UNSURE ( 6.16 ) 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 driver spi-rockchip does not support spi slave mode, but the register map has an entry indicate that the chip support it. An example implementation found here: https://dev.t-firefly.com/thread-101485-1-1.html The patch is my first approach to support slave mode which is needed in one of our projects, the PCBA is not yet available but we think to have it for testing very soon. Yes, the code in the patch isn't tested yet. I found it odd, that the num_chipselect is set fixed to the amount of native chip-select lines rather use the max_native_cs. Changed it. - master->num_chipselect = ROCKCHIP_SPI_MAX_CS_NUM; + of_property_read_u32(np, "num-cs", &num_cs); + master->num_chipselect = num_cs; + master->max_native_cs = ROCKCHIP_SPI_MAX_CS_NUM; That ask to enable cs_gpiods, and support gpio cs + master->use_gpio_descriptors = true; Patch against next-20200505 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