Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3288637imw; Mon, 11 Jul 2022 05:58:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uhbiSdgGudCdWTh7FPL5ORRuUROMzOhZ2TyDlzNv/Y0u0i4zJAdizMTyNp5BD+7daBq2VB X-Received: by 2002:aa7:991a:0:b0:52a:c5df:e17f with SMTP id z26-20020aa7991a000000b0052ac5dfe17fmr8566289pff.52.1657544299927; Mon, 11 Jul 2022 05:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657544299; cv=none; d=google.com; s=arc-20160816; b=R9PzxXhvQkVGzehNLCe07c+Y/n4l8YN/AmhG3bwpP+bHye2Pr0HhHsZ2Dt7Xp0HYnL B20tBhmuYmYCkE5vj5q5tqU6mVsGNwoDjHUqZAPSSRhtiu2YrJqdCyhbhEQjzBhb78ZS JS1Gh5LGRriNK2ZrkJGdnYAnufozJEq811d9RUmIgmrwIPRxQIv2wfd/rWQMgJEJuyhH e8KyuoQKxIQL8OMWYL0ck9EPmXvO3G7pwIBSCjxZBe4S7aFplLpMSojIDeEbhUW6SA5K qNcaHsxJxB08/OQAd3TT208Gi0RlvMK9KUAV5QrrWR46z81x9vsYlp/qLPyABjQ4zfXc Drjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pUxrxpUjUFmLyDY1V3CLpLLNDP18yhbWZiMIrY81H5w=; b=TDRcuX4kFPT8wCI2rG7A5YSPbcMx99iso+lTelvjoFBfBzXeOJa/OD1EhbEWR2Hxed apLXieEoBKnsTbB5VOqdYkWOUZ3eomxG+rJVpMftweEq18ULGX1G02MBms0T++wN2g9A WK1H594aonFHwj2x9UoYeQaJY14grfQptPbnQ5WWSqngVLuHN1IrI9APkxdJIn91PWUv Z1anDLaGnKDYPScoZeJYk4g+EnLk9nn8sJWRogKw1RChlh16FfRK+j2QMwfnDPostRpC c0VKEOc+67kOseRZG14EsVJA3A6P1eVqQVCmjsDcc0BL/j3PaCX4TksmkyCEu9DH8VoN tdrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SwJWULW2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k29-20020a634b5d000000b004150a28a56esi10236140pgl.505.2022.07.11.05.58.06; Mon, 11 Jul 2022 05:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SwJWULW2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231645AbiGKMVU (ORCPT + 99 others); Mon, 11 Jul 2022 08:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbiGKMVU (ORCPT ); Mon, 11 Jul 2022 08:21:20 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E16237DD for ; Mon, 11 Jul 2022 05:21:19 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id f73so8371873yba.10 for ; Mon, 11 Jul 2022 05:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pUxrxpUjUFmLyDY1V3CLpLLNDP18yhbWZiMIrY81H5w=; b=SwJWULW2UYS5nEUkB1Cob6FGI6aQytZXpEsqXW8W+LHXHOe7MAd1hc6xOfgSY/vfWO tAMNZVzSf6QEvXL14yHwwWx6dTdhDQI667Nj9SFRUe9qOsA0ILvk8MT9LmhV2JAXwX5d Jv7n4ntciIuR6aF/aYZp0AJmQiClt6q1Rtb6rZUH077pn73NAl9/vacboLq6C2G8Oxyv E2aSuKX7XJDNavS0gTtVA3ExJ6gz7g3yAX3ijfzNJlA8bHqvnNXWz4jp88KArf9ki8/7 AmgxBqizt656+MeKfxXMYHuye6QbU01/4ukdIPvjrJJQXL+/RcCOYnhS0sMpuL1NPcXX SeXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pUxrxpUjUFmLyDY1V3CLpLLNDP18yhbWZiMIrY81H5w=; b=iDsXSHg9jmU/SpTGgrGnvVuDsGLQQAK41uJ3VCFvRtC3qxGu36Dw75jhBnPXVHL4GF ne4OXRb0/qiaVfdBP97EsIOSOsaKc0y2KpmmG6Jv9dz0bolwDUNNWiaYmELCOQakS5Lp JxufQSqCeuLC8d6jFqYMpifaMvpgV9EtBYAEl7crIFbmHsbLyBVttp5cT18JJ8usFvZs T1b3kbAC+c2Zv6gxKBZYQyvgtueqJHXYJBuUfbQ1G11la2DZniuOka0zxyfjdXTfdQT0 0bLPyKyP+QPffqWWjQlvkU+6CpTCBB10of1fYIUHNhh75N9SdpmjG0JcnwMhtN+uhBrW FX/Q== X-Gm-Message-State: AJIora+CZkJILzBPKk3dsa1K9peAdWOZbsgLGmMaP7sWHmSu5dJ+pZ5k 0kf0JzRLHz2lvwGoLDj75yQNJosO7ZRMQB6bA5bRgg== X-Received: by 2002:a25:e00f:0:b0:66e:2aa9:82b1 with SMTP id x15-20020a25e00f000000b0066e2aa982b1mr16643367ybg.626.1657542078246; Mon, 11 Jul 2022 05:21:18 -0700 (PDT) MIME-Version: 1.0 References: <20220706112828.27278-1-pali@kernel.org> <20220706162111.GA145516-robh@kernel.org> <20220706162335.2eewgf7l3xghdjtr@pali> <20220711121006.kjk44rubi5gpqycj@pali> In-Reply-To: <20220711121006.kjk44rubi5gpqycj@pali> From: Linus Walleij Date: Mon, 11 Jul 2022 14:21:07 +0200 Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: leds: register-bit-led: Add value property To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Rob Herring , Pavel Machek , Krzysztof Kozlowski , =?UTF-8?B?TWFyZWsgQmVow7pu?= , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 11, 2022 at 2:10 PM Pali Roh=C3=A1r wrote: > On Monday 11 July 2022 14:06:50 Linus Walleij wrote: > > On Wed, Jul 6, 2022 at 6:23 PM Pali Roh=C3=A1r wrote: > > > On Wednesday 06 July 2022 10:21:11 Rob Herring wrote: > > > > On Wed, Jul 06, 2022 at 01:28:27PM +0200, Pali Roh=C3=A1r wrote: > > > > > Allow to define inverted logic (0 - enable LED, 1 - disable LED) = via value > > > > > property. This property name is already used by other syscon driv= ers, e.g. > > > > > syscon-reboot. > > > > > > > > Yes, but those are potentially multi-bit values. This is a single b= it > > > > value, and the only value that's ever needed is 0. Why not just use > > > > 'active-low' here? > > > > > > Just because to have uniform definitions across more syscon nodes. > > > > But what happens if he mask and value don't line up? > > > > mask =3D 0x10; > > value =3D 0x08; > > Same what would happen in other drivers, no? > > Only those value bits are take into account which are also sets in the ma= sk. Two wrongs does not make one right. I.e. just because this bad pattern is used in other syscon drivers we do not need to repeat their mistakes. Also, in this case we can only specify one bit due to the way the enum is designed, other drivers may specify multiple bits. This also becomes a bit confusing: + enum: + [ 0x0, What you do is add 0 at the beginning of the enum but that represent a low bit of any from 0-31. I just get confused, active-low is crystal clea= r. Yours, Linus Walleij