From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 EC3AD27FB37 for ; Sat, 21 Feb 2026 07:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771658055; cv=none; b=c+joy2/JL/Lz9g5qU3H0drQdkPw7qnOZwu8Zg4ourxHzW6xAxo84gWgYLbwil0WjL+tshywO9XYOxWSET+NnwDUnABepS61bWfNhLaKCPeyBLi0dlipwkFjez/HzLSweVRNu08QcfO54uT0UxKU0Xod+8SUPMTtc1wxVm7HI/7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771658055; c=relaxed/simple; bh=MW4GX/c88CmZf0BtDY63F/z2OyyF3rvO5grIORC4RIw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M/qzSx2VEfp4PE0V0XgeXel2UnHJQvLAxP2Sup4xMo/TMBpigiJp1yhusU40NVmS8ypbBRK4a7sg1yOmyqnsIwflINl3l7KIWtbEZkb2gUXw+G4gK4hBPHgs6mmkO93s3MHi3pH2hb7VRh5QJfF8/w+7pRP9mZLqGRVyJZOkaYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RQ2AjWDn; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RQ2AjWDn" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2ad3f12a496so17340045ad.1 for ; Fri, 20 Feb 2026 23:14:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771658053; x=1772262853; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IJY8ZZY4WMcXwGgxq6y3UB/v+Z7nyRkvGlTdnxwP0hk=; b=RQ2AjWDnsRK5LYLh9Ghz93ypbOo0DqH8lBQDbfL9BQVpc8YZhfVv2Ovijfp3ODLwYA Ve+B2CtTST1dTZzn509E0qxyNuO2tZDtIeZpdhzDxFw1l15F5sn2Pv/OpM/FJz6TVq7V lTir7ie/jvtA4dE3GyCC9lPIg//UMYzZjhn/Hw2nBbrcZp7iO7LKfgn3qFEKrNi1j9lm vX0VInws/QUtHy64g3LYPq8lnfbDVyPqDAp9cGyIHioeHBByCu9cIxkDg2RgG+B3NjML MP7hed+di9nzo4HiVbp3n8v8lk8lNh5CfpraDUi0qGrqPufvjQN26KFSMIgT5ryrTjnH lBrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771658053; x=1772262853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IJY8ZZY4WMcXwGgxq6y3UB/v+Z7nyRkvGlTdnxwP0hk=; b=lD33kN7n2xgjRHU2PbOfFyug/6Q9msDBB1oCVihA0mDqw/Umt15M8YrehhVqv6ausX xL1MjP/iw19Ehj3YHDrKGqo+XSUKcYy5XOzd2+ptdkGxnXhI5ZXowf3r2P5Ut+Ub5bfS wHCrjxbTU7s9WxbpMQK7ThIw0uqqs+nUMZWOz8VOQN7szQvRm+hfPYEsMdBMxNdznoMz rq/4MvTmRsIYEno/ArwOrdSdLYIXu73cdS/K4dOwB0IcUs0K3katu2jMwfgSZMYoxJSW WPiUBtoyswCr80wr8HiLFBYi4Wt0+Vcju8ZQ8Hzfu6O87pRa+qibFnDpTNBM0EP4LYCD 60mA== X-Forwarded-Encrypted: i=1; AJvYcCWohySI5bIHku3wn/oe96yKKq4LJfstC2HFFC7hiLSyqMkIj0S/qGRASdN5ZxAZR6XwdgdmWYSplQp1Ybk=@vger.kernel.org X-Gm-Message-State: AOJu0YxZAIfRY7nWpzptP9vJ5mA6Ci5I1B3etP5ML7P67TnsLC3Jw6g2 3hUJ2plpDetCb19yYqoxPJ3FpJDHTURLnx+Z6LU4kJ1WhFnoHQRcDCb3 X-Gm-Gg: AZuq6aKFZssCMk8zDe9oen7wTGsMOHicWFHy4xRIhoiit23S5i5iqEXsTbZFwFWmTFE SqSGBuMcfA1zldPluas4dONHn+pI32Eycp91Gu1osSVRCx5ep9KY1oQbEhCtDSAFiGvuNhDd47L 2QwKhh75pVJQpUgv62s5438AdH/pMyU1fyVew00yLlA4VjPUYW4ATMDoD6wcH1DN4XV26QBhVR6 QdeWH/vijSj+y8mFV2wAnhMFa1med51Dp5skBfSMNJUGBKHR+q0UlDUe4fsj4C4d5p9OALEAjkc 9aTWAublBfAMG7HJbFkGxt4oV09+cWniZ1KYMHuk7dW2/ew2vY5wk2eGP7NB6gEgi527qrKGq7O vriAW8Bp69fkz3VyNFDKs9DbMSwWfPJ2IkF8pivPmE0ifcAoFQJeodRFyJPHJYpmOUmgnnU5v2a 7yV4P6r4k7BtlKYnYOlzVbOFx0SBN8m/sNsa0KXWCyzA== X-Received: by 2002:a17:903:2f85:b0:2aa:f43d:7c41 with SMTP id d9443c01a7336-2ad741f51admr21007435ad.10.1771658053228; Fri, 20 Feb 2026 23:14:13 -0800 (PST) Received: from debian.ari ([152.58.178.174]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad7500e2a7sm12657355ad.46.2026.02.20.23.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Feb 2026 23:14:12 -0800 (PST) From: Archit Anant To: neil.armstrong@linaro.org, jesszhan0024@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de Cc: sebastian.reichel@collabora.com, gerald.loacker@wolfvision.net, michael.riesch@collabora.com, miquel.raynal@bootlin.com, wens@kernel.org, airlied@gmail.com, simona@ffwll.ch, architanant5@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v3 1/3] drm/mipi-dbi: Provide option to invert reset GPIO logic Date: Sat, 21 Feb 2026 12:43:49 +0530 Message-Id: <20260221071351.22772-2-architanant5@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260221071351.22772-1-architanant5@gmail.com> References: <20260221071351.22772-1-architanant5@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chen-Yu Tsai When mipi_dbi (tinydrm) was added, the reset handling assumed that "logic high" or "active" was out of reset, while "logic low" or "inactive" was in reset. This is the opposite of how many reset bindings are written, wherein "active" means the reset is active, i.e the device is put or held in reset. Provide an option to invert the logic so that drivers for bindings with "active is in reset" using mipi_dbi can use the common reset handling. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/drm_mipi_dbi.c | 4 ++-- include/drm/drm_mipi_dbi.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 00482227a9cd..7fa1f73a38a4 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -713,9 +713,9 @@ void mipi_dbi_hw_reset(struct mipi_dbi *dbi) if (!dbi->reset) return; - gpiod_set_value_cansleep(dbi->reset, 0); + gpiod_set_value_cansleep(dbi->reset, dbi->invert_reset ? 1 : 0); usleep_range(20, 1000); - gpiod_set_value_cansleep(dbi->reset, 1); + gpiod_set_value_cansleep(dbi->reset, dbi->invert_reset ? 0 : 1); msleep(120); } EXPORT_SYMBOL(mipi_dbi_hw_reset); diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h index f45f9612c0bc..6cebf74bcecc 100644 --- a/include/drm/drm_mipi_dbi.h +++ b/include/drm/drm_mipi_dbi.h @@ -44,6 +44,15 @@ struct mipi_dbi { */ bool swap_bytes; + /** + * @invert_reset: Invert reset logic level. + * + * This is needed as drm_mipi_dbi (formerly tinydrm) introduced reset + * GPIO controls with "logic high" being "out of reset", while other + * bindings typically have "logic high" as "in reset". + */ + bool invert_reset; + /** * @reset: Optional reset gpio */ -- 2.39.5