Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel driver for both clover variants unified #41

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

minlexx
Copy link
Member

@minlexx minlexx commented Sep 25, 2024

Both drivers are based on the same controller and are so similar that only init sequence is different (and even that is very similar). And of course panel resolution and physical size + timings differ too. So it is very easy to have both panels supported in a single driver.

dmesg with this booting: https://paste.sr.ht/~minlexx/07061611fd322e727c021d386b5648cee38af1c5

@minlexx
Copy link
Member Author

minlexx commented Sep 25, 2024

qcom-spmi-gpio 800f000.spmi:pmic@2:gpio@c000: invalid function gpio in map table

there are probably no variations of functions on pmic gpio, so setting function is redundant. I'll recheck

EDIT: there are variations

@minlexx minlexx changed the title Driver for both clover variants unified Panel driver for both clover variants unified Sep 25, 2024
lcd_pwr_en_default: lcd-pwr-en-default-state {
pins = "gpio5";
function = "gpio";
bias-disable;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to find documentation sometimes, but for pmic GPIOs valid function names are documented here https://elixir.bootlin.com/linux/v6.11/source/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml#L500

and also as CI check-dtbs says

gpio' is not one of ['normal', 'paired', 'func1', 'func2', 'dtest1', 'dtest2', 'dtest3', 'dtest4', 'func3', 'func4']
	from schema $id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
/home/runner/work/linux/linux/build-dtbs-check/arch/arm64/boot/dts/qcom/sdm660-xiaomi-clover-plus.dtb: gpio@c000: lcd-pwr-en-default-state: 'oneOf' conditional failed, one must be fixed:
	'bias-disable', 'function', 'pins' do not match any of the regexes: '(pinconf|-pins)$', 'pinctrl-[0-9]+'
	'gpio' is not one of ['normal', 'paired', 'func1', 'func2', 'dtest1', 'dtest2', 'dtest3', 'dtest4', 'func3', 'func4']
	from schema $id: http://devicetree.org/schemas/pinctrl/qcom,pmic-gpio.yaml#

so at least "function" should be changed to "normal" I guess

Valid names for functions are also here: https://elixir.bootlin.com/linux/v6.11/source/include/dt-bindings/pinctrl/qcom,pmic-gpio.h#L98

kubntd and others added 5 commits September 27, 2024 06:22
Add driver for BOE NT51021-based 8-inch and 10-inch DSI video mode
panels used in Xiaomi Mi Pad 4 and Mi Pad 4 Plus (xiaomi-clover)
tablets.

Both panels are very similar, deferences are only in init sequence
and resolution.

Co-Developed-by: Nickolay Goppen <[email protected]>
Signed-off-by: Nickolay Goppen <[email protected]>
Co-Developed-by: Alexey Minnekhanov <[email protected]>
Signed-off-by: Alexey Minnekhanov <[email protected]>
Add fixed gpio-regulator used as panel avdd-supply for both clover variants.
Enable adreno_gpu, mdss.
Rename tlmm pins:
 * mdss_dsi_active -> mdss_dsi_reset;
 * mdss_te_active -> mdss_vsync_active.

Signed-off-by: Nickolay Goppen <[email protected]>
Enable mdss_dsi0, dis0 phy and add panel node.

Signed-off-by: Nickolay Goppen <[email protected]>
Enable mdss_dsi0, dsi phy and describe panel.
Enable and configure wled which is used as backlight.

Signed-off-by: Alexey Minnekhanov <[email protected]>
panel modules for clover and clover-plus
@minlexx minlexx force-pushed the alexeymin/6.11.y-clover-panels-unified branch from b2b1d6b to 0f2cd9c Compare September 27, 2024 03:24
@minlexx
Copy link
Member Author

minlexx commented Sep 27, 2024

This works very well now.

I like how one panel driver can handle both variants - less headache with which modules to include into initramfs for which device variant, etc. Most other drivers also do this for various panels on single controller, so I think this is completely fine and upstreamable solution.

@minlexx minlexx merged commit c355217 into qcom-sdm660-6.11.y Sep 27, 2024
1 check passed
@minlexx minlexx deleted the alexeymin/6.11.y-clover-panels-unified branch September 27, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants