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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 A48A0C43603 for ; Thu, 12 Dec 2019 21:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E580214D8 for ; Thu, 12 Dec 2019 21:08:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730742AbfLLVI1 (ORCPT ); Thu, 12 Dec 2019 16:08:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:59242 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730812AbfLLVI0 (ORCPT ); Thu, 12 Dec 2019 16:08:26 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D14CDAD95; Thu, 12 Dec 2019 21:08:24 +0000 (UTC) Subject: Re: [RFC 04/25] spi: gpio: Implement LSB First bitbang support To: Mark Brown Cc: Geert Uytterhoeven , linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org, Linux Kernel Mailing List , linux-spi , Jacek Anaszewski , Pavel Machek , Linux ARM , Dan Murphy References: <20191212033952.5967-1-afaerber@suse.de> <20191212033952.5967-5-afaerber@suse.de> <9b4b6287-c1d9-1b41-88a8-7ac9fe222642@suse.de> <20191212171922.GM4310@sirena.org.uk> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Organization: SUSE Software Solutions Germany GmbH Message-ID: <70bf4954-d7ab-e300-017c-c743a40162a4@suse.de> Date: Thu, 12 Dec 2019 22:08:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20191212171922.GM4310@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Am 12.12.19 um 18:19 schrieb Mark Brown: > On Thu, Dec 12, 2019 at 04:14:59PM +0100, Andreas Färber wrote: >> Am 12.12.19 um 09:40 schrieb Geert Uytterhoeven: >>> On Thu, Dec 12, 2019 at 4:41 AM Andreas Färber wrote: >>>> Add support for slave DT property spi-lsb-first, i.e., SPI_LSB_FIRST mode. > >>>> Duplicate the inline helpers bitbang_txrx_be_cpha{0,1} as LE versions. >>>> Make checkpatch.pl happy by changing "unsigned" to "unsigned int". > > Separate patch for this? For the checkpatch cleanup? Or helpers preparation vs. spi-gpio.c usage? >> So from that angle I don't see a better way than either duplicating the >> functions or using some macro magic to #include the header twice. If we >> wanted to go down that path, we could probably de-duplicate the existing >> two functions, too, but I was trying to err on the cautious side, since >> I don't have setups to test all four code paths myself (and a ton of >> more relevant but less fun patches to flush out ;)). > > Yeah, I don't think there's any great options here with the potential > performance issues - probably the nicest thing would be to autogenerate > lots of variants but I think that's far more trouble than it's worth. Maybe add another code comment to revisit that idea later then? Thanks, Andreas -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer HRB 36809 (AG Nürnberg)