Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp891lql; Fri, 12 Apr 2024 01:20:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOp44wrZKmPrlemRMM5rMP8I+AorJWItHbq+SUw7KmfFgBM89/I9taGzRyBFygJ0q+Sqz931wucflLH9XjhxEjKpl4Dgm0Lk/X+ouqWw== X-Google-Smtp-Source: AGHT+IF4YHbB88aFp3kG6EEKjEnPrFnBUjpowP2urdwk417O/bB5tWBKZw5WLymDosAxWWDbkdQV X-Received: by 2002:a05:6a20:9714:b0:1a7:c31:2695 with SMTP id hr20-20020a056a20971400b001a70c312695mr2125030pzc.50.1712910052566; Fri, 12 Apr 2024 01:20:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712910052; cv=pass; d=google.com; s=arc-20160816; b=YRLZ37ILHEuIXsbTYko1dlw1efVfjt4Um86vLPiSLkLp9EmRa0CRldzq2jPi9X6lwF J5DarfyF6l9P4eNN3NNfw3URv6YttXWEUKbC3Pe/S14NJrat3WFhjazSoRn/xNcwNBW4 ufhDAJ9GSbiVF2gz3kLx0Jqa0BgOoF1fnt5D7VVTwSY6wDXgkPK/QsHe6bO9tu4+QnvX BmnamN7HkgpbOZjQffVxCkbZx6rNQP5nxpeBFO3WnxrG3fSpOxUcoaIqRJAUEv0i2GLW mfhLx+P9pluXWx0Wlzkp4ZxFC4JPMKuGiTIJXMBfssCLv0cQoVSn6oTyHeti2L/O71At 0PNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Aedlqc/+sWlrdhS4ESFI02d9zvfrw3+3l7iIyP8GAJU=; fh=oKgI9CLyfrLbZCwIJuH82txS2nHv9zIV0dAFgA5qruE=; b=rKa+E3pi1mYMVeRI3c7xq+VGIRE5x4vamwLoiRNq+lMbejUhPL+yE6DZP4SlcHa0Ew hSBK0XhdPhojRWihkLLxn34YJstKofA8fBVJPSNZP8D1J2p6+xlyOK6tO0KLuXBiw6Au uUYBR37BTT2LFQ5R7Mn5nihtq6S9XLCL3GfKoJdAwnAwouUOR0dX73LITmwPVlrGbkTg 1snqMTpz6ua+8QvwQ/CMnYVPDE3kflVMmrW7ZdBo2cuyWsmtxYeKvPG4gRAdxxn0Qcjg sU+bR5VDl0Bn/vZCIHHpSgYZnd+6eGfR/U/tpYubhYiaDglZjLSN3TXxQ7ANg796fZDt F1WA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pnL+1Sr3; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-wireless+bounces-6230-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t11-20020a62ea0b000000b006eac2e5407asi2857351pfh.117.2024.04.12.01.20.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 01:20:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6230-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pnL+1Sr3; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-wireless+bounces-6230-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3CA1C2830A0 for ; Fri, 12 Apr 2024 08:20:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44B895029B; Fri, 12 Apr 2024 08:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pnL+1Sr3" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20B404F20C for ; Fri, 12 Apr 2024 08:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712910038; cv=none; b=d0YEucTf/LpthUlAIf9DPqS8eJ3bNZj/aJY0ncr4VwC3iJpdrkiK1uGuZXl3l8CYVXp4wKmsh8qCisjnvD+8bf3JqViVpEN8r3wdlwthZmrYmXgi/MkyYJ7Abdt/QtduQ+0gexo+3ttXA8ZAAQQ+sCb8/EDqFBQkMINHlbGsyLg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712910038; c=relaxed/simple; bh=Aedlqc/+sWlrdhS4ESFI02d9zvfrw3+3l7iIyP8GAJU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Fy5M0dNUvIoYD5dXxCLxmqVbfuPr5mz/RvsaDcIAm8zuS3veTrAuEVLmIwj/JAIZl4bPXJotY8HdRJ1UV08QKWsgKkjCh9+4M9rtvvWfRYJuPxoHBGd7Pn7k8QZij+oD61zVml98AKRj67fl59tL4LsXstaIFuPPby+eauvlasQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=pnL+1Sr3; arc=none smtp.client-ip=209.85.128.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-617d25b2bc4so6646317b3.2 for ; Fri, 12 Apr 2024 01:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712910035; x=1713514835; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Aedlqc/+sWlrdhS4ESFI02d9zvfrw3+3l7iIyP8GAJU=; b=pnL+1Sr3OS3NKG3k5J+w65//o3EjhVJplqV+2KPYVP63ibnUzivdsegG5bMc1NmFl+ winlpfLRlFAJotdxT8oxc9y6xP7pWKNw2hUw+fTdsNjzjtHC8ZYwouyuKAoBhPostRBW Sj3U9COIS5VSZKXRLfVDPnCHSWilWEmLMlnTGJmeeNs+NuUhMR/0kF7aFVhVCJbQZueB vt6QpCqkvPdz7rwHiYoJ/lnCLELf6oVgufcOiBmPmlrRTfT/sIR4GEZyii2z5xjdJJCo pm0F0n/bxuAuXKjkNmaktu5Xx601a2Jh3uVwW9Tcaz2hQHCyFUBUEfsEqhaA7depus6a EEwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712910035; x=1713514835; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Aedlqc/+sWlrdhS4ESFI02d9zvfrw3+3l7iIyP8GAJU=; b=LDRVeDoxUwI4SwV/dDfFcH4wTlM4kGLayJvg2zP/ClRsU6a5qDnm/Z9Kc1bsROVeAE BwqfG3rg59gHGZjjwLOBPiy/4vJ1NXWV/CvEdjG4NiZ8VGYB0YzUBdOKPLqJnSKwx2PV bamEANlhxBhKhEHs424zlT/mH8Z+eWX/QernQvInyYez79m98iD6CAq6wfVu5LkcZ+xX CqnaWVm11HuTUKid34/S6ysdk1+hWPYcS3FmDyNoxNosdSrPpb6vlX/DGbaZ8abw6AQl dXkQNK+PeXpdK467TnfnoIniAjjat0v05uLXYxgHHP8Q2hyoz2+3qhhvt0ARqe3NeSJk geYQ== X-Forwarded-Encrypted: i=1; AJvYcCWiDBEJJK8dJCQzGML8nPHNHXKrCoai6wp0rTrQKhDBJZ9Pze78pM2iRaxBFY1+A0cZrF2IxkCgoxxHPtlSUcDudxZt1P4J9hHpBdJC26s= X-Gm-Message-State: AOJu0YwkM5MOkZjxSyav6m5c9+30vKk/ubCL8M6HgVM/d8+wARdS2xX6 Tj2DeLlVg1OUSxvqj+ulVrLHxiWvPsU3gMG2eNnCVKq0iN/2QLCuHc3wfYLQy+b76uj3qBYxbVN FIERB8A0XSSoL0oZc7k5BtZ8yNcfVUM8ER4QSdPDzbifz1wN4xvU= X-Received: by 2002:a25:900f:0:b0:dcd:40fa:7bd0 with SMTP id s15-20020a25900f000000b00dcd40fa7bd0mr1617358ybl.3.1712910035197; Fri, 12 Apr 2024 01:20:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240408231727.396452-1-andriy.shevchenko@linux.intel.com> <20240408231727.396452-2-andriy.shevchenko@linux.intel.com> In-Reply-To: <20240408231727.396452-2-andriy.shevchenko@linux.intel.com> From: Linus Walleij Date: Fri, 12 Apr 2024 10:20:24 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] gpiolib: Fix a mess with the GPIO_* flags To: Andy Shevchenko Cc: Bartosz Golaszewski , Kent Gibson , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, Mika Westerberg , Bartosz Golaszewski , Arend van Spriel , Kalle Valo , Charles Keepax Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 9, 2024 at 1:17=E2=80=AFAM Andy Shevchenko wrote: > The GPIO_* flag definitions are *almost* duplicated in two files > (with unmatches OPEN_SOURCE / OPEN_DRAIN). Moreover, some code relies > on one set of definitions while the rest is on the other. Clean up > this mess by providing only one source of the definitions to all. > > Fixes: b424808115cb ("brcm80211: brcmsmac: Move LEDs to GPIO descriptors"= ) > Fixes: 5923ea6c2ce6 ("gpio: pass lookup and descriptor flags to request_o= wn") > Fixes: fed7026adc7c ("gpiolib: Make use of enum gpio_lookup_flags consist= ent") > Fixes: 4c0facddb7d8 ("gpio: core: Decouple open drain/source flag with ac= tive low/high") > Fixes: 69d301fdd196 ("gpio: add DT bindings for existing consumer flags") > Signed-off-by: Andy Shevchenko The way the line lookup flags ("lflags") were conceived was through support for non-DT systems using descriptor tables, and that is how enum gpio_lookup_flags came to be. When OF support was added it was bolted on on the side, in essence assuming that the DT/OF ABI was completely separate (and they/we sure like to think about it that way...) and thus needed translation from OF flags to kernel-internal enum gpio_lookup_flags. The way *I* thought about this when writing it was certainly that the DT bindings was a separate thing ( didn't even exist at the time I think) and that translation from OF to kernel-internal lflags would happen in *one* place. The main reasoning still holds: the OF define is an ABI, so it can *never* be changed, but the enum gpio_lookup_flags is subject to Documentation/process/stable-api-nonsense.rst and that means that if we want to swap around the order of the definitions we can. But admittedly this is a bit over-belief in process and separation of concerns and practical matters may be something else... Yours, Linus Walleij