From nobody Fri Apr 17 04:47:45 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21C7233121E for ; Mon, 23 Feb 2026 17:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771867236; cv=none; b=binYs+Ih78tfTF+KkhHJzVIpNCS0R9sc2gzDgzUCfvZxV7HdV9V9viy6HnLuC66shXkSyKXF8y+2ukWo1nB/+aH7M8lvCCIZmll3P+VVAj9/rYjz9joGQZ9VQ90+k+Pf4hMmSggiRrmH14oIXUVbX4gq83pRUsXdP3BdvzY/JPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771867236; c=relaxed/simple; bh=R5vyUoxzMKZBr/4OKZ1zuAgg1NQZEyG40i4c6aD1424=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=B+rLThef2l0soSXp1wE5ZlWpZQdipIrIN0v/NwM4X0mVcysJHKw8EtOMqeUKGftuuHJdRXqeVhlz65WT10sPzZqhFpcj9bqfoN9KNAW6aEP7pMoSW8ZYeqgJ6DdzJsQlurrODceAps+IZFh0pRyhIDDZa9PWaajgIMJQ9QyT2ds= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=g4bEPcjb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bNolqhMO; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="g4bEPcjb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bNolqhMO" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61NGRJvN1640607 for ; Mon, 23 Feb 2026 17:20:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=mUgVAINOURDQvrKq3PsyBB4PRlaSvdw0zwk bxHvqzps=; b=g4bEPcjbuodmPKv9OPbx1ns9rryZ/Imb78+aj6SD6O2bcaD9NkK JjtDLiUdxwuyUp4nHyGT+knUX5bjjOlz6kgkNE5GedzNW4Nzj4A+AP9+BeUjl1wr JuxG8ABZcNr/GYoIjCRIske458Bcogp2gPmdw/qvGsJ4JgAvyRIwIpA59DICQ5pe CS5I/zoMX6X+0UOB4fuzbyiH0w+A/6oMnhvuYoIV/ScGMHOQquPpSyI2k3SQffTT Z6VyRX6rVEp9SAwAfu3Gl1fHR6CUngcyyq7UfCySfzenOidfH4HY8vKhiDbleNTY PokjtsG7Sz4WfNL8EhmxTjwTJtX6ex/pO6g== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgte8r5wy-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 17:20:31 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb706313beso649250285a.3 for ; Mon, 23 Feb 2026 09:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771867231; x=1772472031; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mUgVAINOURDQvrKq3PsyBB4PRlaSvdw0zwkbxHvqzps=; b=bNolqhMOQ9DD/3/pTLMqbpvU0GP+YnE38gJJTEBY7r12rrSQYq4cOIPLOx3nnqkbK4 h7XWutJ3o1ggKtKYsCv+907hXzEgKoS3LSgZ0mIR8XK/bEV/e/Ydk1+IQH4AULYQqAh4 NBUS+DI9H/g9YXfbLkSsE7qG5zfC6FSS81vEBomcnB6VgHgd3QmJtKD7o9hIIu08C5R9 9MojhorR+qm+h3FGLn5YmsgjaorwTHjhpx0b1dNWNcCXlS7XdBrFJMhF3NDLwlnei9s6 ouC74PaGloFiR0FMMnM5mKDbOxwd6UQ0vVrz4oDZ0lqdrAx3MdX3X9ntd+8iVIdsi12V uZlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771867231; x=1772472031; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mUgVAINOURDQvrKq3PsyBB4PRlaSvdw0zwkbxHvqzps=; b=S42AZDKNSX9Z4NKJOzMWmcHyAU9L3bDKQ4ogW0iOgFWLBg5yJL8zTVzTaURYVuNjtC zL3EaA1zAGFtHNsVsy+nERE3MS35GHsfAiUJeW0Ig1h/y2u/hd7EABrlzQBqGewYDL/L 2HuegRRgw/snf8J4/wRaWJY8NkR2ZUfPcIIgX3FDNrZEXHoV2GMcNlhEdVRRxpy467ah ae6gFhCHlz0Ahz/2gBPnZ6Ol4qP6svRj3JhlC2CCPAEhh5JSv2QNH1DaSq/6Rw3NPN8K 0ySqQFoh8NXmFSabIZlOo9kWaAmrxKq90Y2yZeNRCA94Fb7Lmlc392melACG1hC3grhU CWfQ== X-Forwarded-Encrypted: i=1; AJvYcCVguaKE9tSFenjzkvhuI5fpF9J+79mWTjMm+c5Kh0j229mpMTEJr4CdaB5psC4rzkJPFAevCeCxutUbXeU=@vger.kernel.org X-Gm-Message-State: AOJu0YxYdVTnJo6YZe4Nz/jLYslDGXdihPdxHx9ksPgrFIY22kU7mJSl 52dCRg8oS6mcbG00NCYS8ZHKH7C1YLTQxzOie+5gDxiRsNA3loKS8jNyfXhe59s8H80NfFUvlzf mRxnSF2ORBie/nKMRNyhtuZZSssw8eTDA9aEEeXRZO0wu/DVnRCyjNTAHAhlXKi7YHkU= X-Gm-Gg: AZuq6aLLfkAbYO7aVmX1wnXYNsq0oIl3lHBOaKZFvBLb4enjgKnZ+En1vPDC86HegTP KoArNZPzP+8NrOPqAD6anW0u5DoFSjjqHBJyMfJlDHA301BxPF/ozNYfPz1us00lv2PNBa2SIuc 1Gwg65Gq0yPYw6n1dla98aFsk4oVKmZFn2gMCbtIGilzSpQXuWCrbs+0X0iy9gpoibz54l0UDak gad7hPaxPvft0J83RLn5rssbTY3wyhwhXLtj7vh3gslIJo9FFAllTI0NnQ6jKWyxjDbdQo2u0Cs c0+fRiA+xqkHYLh9oRDQGo/L/bGW13Y2G/hAXFGomRyC9TBpufwQBu2q0CX6mpdn0omhUS3VlVM UKc3oZW1cagj6fb46HI7zpREcPNpBoQkiW745Ql7cQXmuQiAiUA== X-Received: by 2002:a05:620a:190a:b0:8a2:e1db:f442 with SMTP id af79cd13be357-8cb8c9fecf7mr1186196785a.30.1771867231009; Mon, 23 Feb 2026 09:20:31 -0800 (PST) X-Received: by 2002:a05:620a:190a:b0:8a2:e1db:f442 with SMTP id af79cd13be357-8cb8c9fecf7mr1186191285a.30.1771867230405; Mon, 23 Feb 2026 09:20:30 -0800 (PST) Received: from brgl-qcom.home ([2a01:cb1d:dc:7e00:2ac2:9089:69df:f2e0]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970c09897sm21030868f8f.17.2026.02.23.09.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 09:20:29 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] gpio: introduce a header for symbols shared by suppliers and consumers Date: Mon, 23 Feb 2026 18:20:06 +0100 Message-ID: <20260223172006.204268-1-bartosz.golaszewski@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: S3vEkyM7s5cAisp6nbqowMf0r5mz768W X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE0OSBTYWx0ZWRfX7FI/peWBNEy7 W1MstqnSXY9tLwPQqDBI9TojcoEGerKLcxkvfvfgu5wLeZ8mMOzaYNzUi83tyKLIQF0ALZ3aBNV hnqQpl1V463VcnI7k0s61bj7cFVqbfj55jWRqUeg0koE0T2c0sNwVqAla8eSgMfBZvxdLnxb+B/ ti/LhEaAFly0HE3y9I1xXceA5GhlZoSDz0+2zRiFJ1yEZNVpz3gRn9nWYYJGDTtHsk5XJxNbkwB gKOoXt6oUhoTD4tmR2SmLNasT+BGGzVjSJbMaYvMkBje5l0qbEAwtA75uQAiPEDNOrxKn2wL5Zc qv0rlrSDGRAOdYgRxIoNI4V8ErMf3mrdYGEC46he1WMI+nGgE93ADYxFR35kw3BaQVkOsb5rE/j Jikx6sOWwC0gy3Zon2vQ8tmQdq3RP8bvafuuK2JuH1/cnFrlQWma6tMSAOK897AdiuqXtWDg/vg 8pAjYlAS3nzx9mTc3Gg== X-Proofpoint-GUID: S3vEkyM7s5cAisp6nbqowMf0r5mz768W X-Authority-Analysis: v=2.4 cv=WqQm8Nfv c=1 sm=1 tr=0 ts=699c8c5f cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=j6jmTg-VOEBk01pMHWgA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230149 Content-Type: text/plain; charset="utf-8" GPIO_LINE_DIRECTION_IN/OUT definitions are used both in supplier (GPIO controller drivers) as well as consumer code. In order to not force the consumers to include gpio/driver.h or - even worse - to redefine these values, create a new header file - gpio/defs.h - and move them over there. Include this header from both gpio/consumer.h and gpio/driver.h. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Suggested-by: Andy Shevchenko --- Andy, Linus: I'm no longer sure who proposed it but I've had it on my TODO list. Please feel free to take credit below. include/linux/gpio/consumer.h | 2 ++ include/linux/gpio/defs.h | 9 +++++++++ include/linux/gpio/driver.h | 5 ++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 include/linux/gpio/defs.h diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 0d84085829186..3efb5cb1e1d16 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -6,6 +6,8 @@ #include #include =20 +#include "defs.h" + struct acpi_device; struct device; struct fwnode_handle; diff --git a/include/linux/gpio/defs.h b/include/linux/gpio/defs.h new file mode 100644 index 0000000000000..b69fd7c041b28 --- /dev/null +++ b/include/linux/gpio/defs.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __LINUX_GPIO_DEFS_H +#define __LINUX_GPIO_DEFS_H + +#define GPIO_LINE_DIRECTION_IN 1 +#define GPIO_LINE_DIRECTION_OUT 0 + +#endif /* __LINUX_GPIO_DEFS_H */ diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index fabe2baf7b509..5f5ddcbfa4459 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -20,6 +20,8 @@ #include #endif =20 +#include "defs.h" + struct device; struct irq_chip; struct irq_data; @@ -42,9 +44,6 @@ union gpio_irq_fwspec { #endif }; =20 -#define GPIO_LINE_DIRECTION_IN 1 -#define GPIO_LINE_DIRECTION_OUT 0 - /** * struct gpio_irq_chip - GPIO interrupt controller */ --=20 2.47.3