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=-5.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 CCFE7C433ED for ; Mon, 10 May 2021 11:50:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADC1B611C2 for ; Mon, 10 May 2021 11:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234948AbhEJLv7 (ORCPT ); Mon, 10 May 2021 07:51:59 -0400 Received: from mga07.intel.com ([134.134.136.100]:26700 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240990AbhEJLhT (ORCPT ); Mon, 10 May 2021 07:37:19 -0400 IronPort-SDR: ccV9khc7HLZARv4jNUhEUfBNIYOvUJmu2cHHiucHebBTgftirop/SuqIJ+Q4rWZU8nw98EHfYy D5+9f/egxr3A== X-IronPort-AV: E=McAfee;i="6200,9189,9979"; a="263104327" X-IronPort-AV: E=Sophos;i="5.82,286,1613462400"; d="scan'208";a="263104327" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 04:36:13 -0700 IronPort-SDR: RBfyB5z5WIuHe0GlaPbiDUMdtPGMsy2NL50pmyN/e+vHoPvuNHDwMTVsdj4XaviP1a4WmbDM0s L/a16fGCrTfg== X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="536381037" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 04:36:12 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lg4Cn-00B9ko-IQ; Mon, 10 May 2021 14:36:09 +0300 Date: Mon, 10 May 2021 14:36:09 +0300 From: Andy Shevchenko To: Sven Van Asbroeck Cc: Linus Walleij , "broonie@kernel.org" , "xhao@linux.alibaba.com" , "linux-spi@vger.kernel.org" Subject: Re: [PATCH v1] spi: fix client driver can't register success when use GPIO as CS Message-ID: References: <83ab9b6c-8fb2-b053-ecb3-04230ca34e48@linux.alibaba.com> <6bd8f178-51a2-3f45-8a16-80fdd4a3ed8e@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Sat, May 08, 2021 at 07:46:13AM -0400, Sven Van Asbroeck wrote: > On Sat, May 8, 2021 at 3:38 AM Andy Shevchenko > wrote: > >> 2. Drive the gpiod chip select using the raw value, ignoring the > >> built-in polarity, which treats it the same as a gpio_xxx. Nice! > >> > > > > Looks nice (if for now don’t take into account the zillion of drivers to be changed), but IIRC last time discussions about this piece of code, the problem also in DT itself, you may not break boards with already cooked DTs. If you are sure about this, go ahead! > > Yes, you're absolutely right, the zillion of drivers to be changed is > a serious problem. I'm definitely not trying to sweep that under the > carpet... > > The rule table seems to indicate that the gpio's second devicetree > flag is ignored when it's used as a SPI gpio. So changing where the > polarity is stored, should not break DT? It may have repercussions > elsewhere though, not sure. > > (I hope the formatting will come out ok here. If not, use the link below) > device node | cs-gpio | CS pin state active | Note > ================+===============+=====================+===== > spi-cs-high | - | H | > - | - | L | > spi-cs-high | ACTIVE_HIGH | H | > - | ACTIVE_HIGH | L | 1 > spi-cs-high | ACTIVE_LOW | H | 2 > - | ACTIVE_LOW | L | > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/spi/spi-controller.yaml?h=v5.12#n54 This table is incompatible with ACPI. So we can't unify them until each of them will play by the same rules. Can't say it won't happen, but it's far from that. -- With Best Regards, Andy Shevchenko