Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbcDQWT4 (ORCPT ); Sun, 17 Apr 2016 18:19:56 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:51116 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbcDQWTx (ORCPT ); Sun, 17 Apr 2016 18:19:53 -0400 From: Arnd Bergmann To: "Reizer, Eyal" Cc: Kalle Valo , Eyal Reizer , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , linux-spi@vger.kernel.org Subject: Re: [PATCHv2] wlcore: spi: add wl18xx support Date: Mon, 18 Apr 2016 00:19:41 +0200 Message-ID: <14313437.cDJIgY3kzo@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <8665E2433BC68541A24DFFCA87B70F5B360B6C90@DFRE01.ent.ti.com> References: <1460273570-12298-1-git-send-email-eyalr@ti.com> <8665E2433BC68541A24DFFCA87B70F5B360B6C90@DFRE01.ent.ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:jT/X4+nS+VEAhmhztj3CeY9hUcD8blSZymUww9LZqamMHdMVtzJ ompjoV2Whcnkpjx7jvf+4VlfuPQz3lAmAWgwT1pK7u7OhQTh6Jz4e6lCjhgIOgsq2I31+io n9YTJWFppBgFXM1whVF7EzifOBnpwUhq0r5652Z4l9lhFBguxqxr2Jabia443ugiknsQXuk s/SLfOAmX/qLYsu07L0qw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Y8SF0LXdduY=:pPLvNjPF3wc6VSXgirQOSd 1zcEG+if0b5/61HPTCasiqxjEYgVzeA+e5W9YimIOAgP4gdV3EmTM7aEwqlGZ84vnB/lpkjfX +3yxAK8JVIEfZue5XQHv0mo9uQv5Uji9e+D6taI++4Xmz/4c9yF6HeoUhIpO4r7LMbJfwHw6d 779Bu68Ytu2aWbEc0V/Gp79bh179wwKNkiRd/tVduI8hTnn7TN3mI578yiQQGUPXoUybTNqAw 0/3ZkDPKLx50qv8Gup01BbrONdTGKxmMG8T8L150C8WJ7gn4Nxjg6V1znCrJLcHfSQLURIPjr DqfyO6ZlBKB+9yuelTMzI2iGqRKL4VWTsXUu54i2vNTXRPUiYCgGOi2g2ezJnzaMRXxaLWu8T M7vM2dcX9OHyovo3skbWCnmL7Nocfw3LsPFSqBOmaBiJsMY+vOAsmAiFnWL2d2Rxgmi97SVTV qzOCj9MNNOlkj7kJh+Y/zOSGQF/4N3J2yh+ewZtNs9MVjcG3nOT299E1Bc3jK/T+khz2MXqyP A/Zpa1U9XxErmZK0jI/5wlyy8TGoVnBpDjcCiDlXAkO445HXIBOoWQvTEbwPSi51ZJ64y1Hon QBiE+sWnm2KHexkMekExfhevkpS5qdQoYK/9h1384L7iYLujD0sfj2Hi9k2wa+nsCy7+uy1th Op7tjEpzAYd/MrfZYnqLGK567hpppwamuXnPo8hogGHSMBbCFDT6aU48jQp8ZLTjS9xd+7VUN JJvVX+72++eYJmjQ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1112 Lines: 32 On Sunday 10 April 2016 07:37:23 Reizer, Eyal wrote: > Add support for using with both wl12xx and wl18xx. > > - all wilink family needs special init command for entering wspi mode. > extra clock cycles should be sent after the spi init command while the > cs pin is high. > - switch to controling the cs pin from the spi driver for achieveing the > above. > - the selected cs gpio is read from the spi device-tree node using the > cs-gpios field and setup as a gpio. > - See the example below for specifying the cs gpio using the cs-gpios entry > &spi0 { > ... > cs-gpios = <&gpio0 5 0>; > ... > wlcore: wlcore@0 { > compatible = "ti,wl1835"; > ... > ... > }; > }; > > Signed-off-by: Eyal Reizer I don't think this can work in general: not all SPI hosts uses GPIOs for controlling CS, so the logic can't work, and it's also a layering violation for the driver to look at the parent. I would suggest fixing this using a new API function from the SPI core, if we don't already have a generic way to do it. Arnd