X86 platform drivers
 help / color / mirror / Atom feed
From: Yauhen Kharuzhy <jekhor@gmail.com>
To: Hans de Goede <hansg@kernel.org>
Cc: "Bartosz Golaszewski" <brgl@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Arnd Bergmann" <arnd@kernel.org>,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v4 01/20] platform/x86: x86-android-tablets: convert Goodix devices to GPIO references
Date: Tue, 10 Feb 2026 01:13:02 +0200	[thread overview]
Message-ID: <aYpp_u5R9JefpLwG@jekhomev> (raw)
In-Reply-To: <978f0855-7d77-413c-892b-7ca9cb78e9ce@kernel.org>

On Mon, Feb 09, 2026 at 03:18:55PM +0100, Hans de Goede wrote:
> On 9-Feb-26 15:00, Hans de Goede wrote:
> 
> ...
> 
> > For the drivers/platform/x86/x86-android-tablets/* I think the following
> > fix is both the easiest as well as the best solution is to modify:
> > 
> > drivers/pinctrl/intel/pinctrl-baytrail.c
> > drivers/pinctrl/intel/pinctrl-cherryview.c 
> > 
> > To register a swnode for each GPIO controller and
> > then EXPORT_SYMBOL_GPL an array of fwnode pointers
> > which can then be used in the PROPERTY_ENTRY_GPIO()
> > entries replacing e.g.:
> > 
> > PROPERTY_ENTRY_GPIO("reset-gpios", &cherryview_gpiochip_nodes[1], 53, GPIO_ACTIVE_HIGH)
> > 
> > with:
> > 
> > PROPERTY_ENTRY_GPIO("reset-gpios", cherryview_gpiochip_fwnodes[1], 53, GPIO_ACTIVE_HIGH)
> > 
> > (these 2 covers pinctrl for the Bay Trail and Cherry Trail x86
> > SoC based Android tablets which x86-android-tablets is for).
> > 
> > This should all be pretty straight forward. Assuming we are allowed
> > to dereference an external symbol for the property initialization
> > if not then this becomes significantly more complex.
> 
> Looking at how the current code works, it does not use an array
> of swnode pointers, it just uses an array of swnodes, and then
> takes the address of the n-th member:
> 
> PROPERTY_ENTRY_GPIO("reset-gpios", &cherryview_gpiochip_nodes[1], 53, GPIO_ACTIVE_HIGH)
> 
> so if we just move the:
> 
> extern const struct software_node baytrail_gpiochip_nodes[];
> extern const struct software_node cherryview_gpiochip_nodes[];
> 
> arrays to the 2 pinctrl drivers and actually associate them
> with / attach them to the GPIO controllers in the pinctrl
> drivers then I think that we will be set for all the references
> to the main SoC GPIO controllers (at the cost of a dependency
> on the pinctrl driver, but that is ok).

OK, but what about additional GPIO chips? For example, on Lenovo YB1-X9*,
sound codec controls additional signals like speaker amplifier
enablling. I did such trick but it looks very... weird: codec device
properties reference fake node for gpiochip which will be created at
driver instantiation (these properties are used by ASoC machine driver
actually):

static const struct property_entry lenovo_yb1_x9x_rt5677_props[] = {
...
	PROPERTY_ENTRY_GPIO("realtek,reset-gpios", &cherryview_gpiochip_nodes[3], 25, GPIO_ACTIVE_LOW),
	PROPERTY_ENTRY_GPIO("realtek,pow-ldo2-gpios", &cherryview_gpiochip_nodes[3], 18, GPIO_ACTIVE_HIGH),
	PROPERTY_ENTRY_GPIO("speaker-enable-gpios", &cherryview_gpiochip_nodes[3], 48, GPIO_ACTIVE_HIGH),
	PROPERTY_ENTRY_GPIO("speaker-enable2-gpios", &lenovo_yb1_rt5677_gpiochip_node, 2, GPIO_ACTIVE_HIGH),
	PROPERTY_ENTRY_GPIO("headphone-enable-gpios", &lenovo_yb1_rt5677_gpiochip_node, 4, GPIO_ACTIVE_HIGH),
	{}
};

static const struct software_node lenovo_yb1_x90_rt5677_node = {
	.properties = lenovo_yb1_x9x_rt5677_props,
};

...
		.board_info = {
			.type = "rt5677",
			.addr = 0x2c,
			.dev_name = "rt5677",
			.swnode = &lenovo_yb1_x90_rt5677_node,
		},
...

https://github.com/jekhor/yogabook-linux-kernel/commit/538313b69483c23afc455571ef638efcea767031#diff-282276fa1330b08656b929c6e956308a122423888b8f07a1d1045e61a813d8c2R159


-- 
Yauhen Kharuzhy

  reply	other threads:[~2026-02-09 23:13 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-20 20:06 [PATCH v4 00/20] x86-android-tablets: convert to use GPIO references + Acer A1-840 support Hans de Goede
2025-09-20 20:06 ` [PATCH v4 01/20] platform/x86: x86-android-tablets: convert Goodix devices to GPIO references Hans de Goede
2026-02-08 23:32   ` Yauhen Kharuzhy
2026-02-09  8:08     ` Andy Shevchenko
2026-02-09 11:52       ` Bartosz Golaszewski
2026-02-09 14:00         ` Hans de Goede
2026-02-09 14:18           ` Hans de Goede
2026-02-09 23:13             ` Yauhen Kharuzhy [this message]
2026-02-10 10:46               ` Hans de Goede
2026-02-10 17:18                 ` Yauhen Kharuzhy
2026-02-09 14:36           ` Bartosz Golaszewski
2026-02-09 14:46             ` Dmitry Torokhov
2026-02-09 16:30               ` Bartosz Golaszewski
2026-02-09 16:40                 ` Dmitry Torokhov
2026-02-09 16:45                   ` Bartosz Golaszewski
2026-02-09 17:25                     ` Dmitry Torokhov
2026-02-09 14:41           ` Dmitry Torokhov
2026-02-09 15:13             ` Arnd Bergmann
2026-02-09 15:22               ` Andy Shevchenko
2026-02-14  0:29               ` Dmitry Torokhov
2026-02-09 15:50             ` Bartosz Golaszewski
2026-02-09 16:25             ` Bartosz Golaszewski
2026-02-09 17:23               ` Dmitry Torokhov
2026-02-09 20:24                 ` Bartosz Golaszewski
2026-02-09 20:41                   ` Dmitry Torokhov
2026-02-10  9:53                     ` Bartosz Golaszewski
2026-02-12  3:44                       ` Dmitry Torokhov
2026-02-12 10:01                         ` Bartosz Golaszewski
2026-02-12 10:24                           ` Bartosz Golaszewski
2026-02-12 10:28                           ` Andy Shevchenko
2026-02-12 15:49                             ` Dmitry Torokhov
2026-02-12 16:12                               ` Andy Shevchenko
2026-02-12 16:14                                 ` Andy Shevchenko
2026-02-12 16:50                                   ` Dmitry Torokhov
2026-02-12 17:07                                     ` Bartosz Golaszewski
2026-02-12 17:18                                       ` Dmitry Torokhov
2026-02-13 13:41                                         ` Bartosz Golaszewski
2026-02-13 14:03                                           ` Arnd Bergmann
2026-02-13 16:05                                           ` Hans de Goede
2026-02-13 16:18                                             ` Bartosz Golaszewski
2026-02-12 10:25                         ` Andy Shevchenko
2025-09-20 20:06 ` [PATCH v4 02/20] platform/x86: x86-android-tablets: convert Wacom " Hans de Goede
2025-09-20 20:06 ` [PATCH v4 03/20] platform/x86: x86-android-tablets: convert HiDeep " Hans de Goede
2025-09-20 20:06 ` [PATCH v4 04/20] platform/x86: x86-android-tablets: convert Novatek " Hans de Goede
2025-09-20 20:06 ` [PATCH v4 05/20] platform/x86: x86-android-tablets: convert EDT " Hans de Goede
2025-09-20 20:06 ` [PATCH v4 06/20] platform/x86: x86-android-tablets: convert int3496 " Hans de Goede
2025-09-20 20:07 ` [PATCH v4 07/20] platform/x86: x86-android-tablets: convert wm1502 " Hans de Goede
2025-09-20 20:07 ` [PATCH v4 08/20] platform/x86: x86-android-tablets: convert HID-I2C " Hans de Goede
2025-09-20 20:07 ` [PATCH v4 09/20] platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger " Hans de Goede
2025-09-20 20:07 ` [PATCH v4 10/20] platform/x86: x86-android-tablets: remove support for GPIO lookup tables Hans de Goede
2025-09-20 20:07 ` [PATCH v4 11/20] platform/x86: x86-android-tablets: convert gpio_keys devices to GPIO references Hans de Goede
2025-09-20 20:07 ` [PATCH v4 12/20] platform/x86: x86-android-tablets: replace bat_swnode with swnode_group Hans de Goede
2025-09-20 20:07 ` [PATCH v4 13/20] platform/x86: x86-android-tablets: use swnode_group instead of manual registering Hans de Goede
2025-09-20 20:07 ` [PATCH v4 14/20] platform/x86: x86-android-tablets: Simplify node-group [un]registration Hans de Goede
2025-09-21 19:37   ` Andy Shevchenko
2025-09-20 20:07 ` [PATCH v4 15/20] platform/x86: x86-android-tablets: Update my email address Hans de Goede
2025-09-20 20:07 ` [PATCH v4 16/20] platform/x86: x86-android-tablets: Move Acer info to its own file Hans de Goede
2025-09-20 20:07 ` [PATCH v4 17/20] platform/x86: x86-android-tablets: Add support for Acer A1-840 tablet Hans de Goede
2025-09-20 20:07 ` [PATCH v4 18/20] platform/x86: x86-android-tablets: Simplify lenovo_yoga_tab2_830_1050_exit() Hans de Goede
2025-09-20 20:07 ` [PATCH v4 19/20] platform/x86: x86-android-tablets: Fix modules lists for Lenovo devices Hans de Goede
2025-09-20 20:07 ` [PATCH v4 20/20] platform/x86: x86-android-tablets: Stop using EPROBE_DEFER Hans de Goede
2025-09-24 12:58 ` [PATCH v4 00/20] x86-android-tablets: convert to use GPIO references + Acer A1-840 support Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYpp_u5R9JefpLwG@jekhomev \
    --to=jekhor@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=arnd@kernel.org \
    --cc=brgl@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox