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

Add support for Asus Portable AiO P1801-T #123

Merged
merged 11 commits into from
Jun 17, 2022

Conversation

maximschwalm
Copy link
Contributor

No description provided.

@digetx
Copy link
Member

digetx commented May 19, 2022

Thanks @maximschwalm. I'm going to review this over the weekend.


if (data->reset_gpio) {
msleep(1);
gpiod_set_value(data->reset_gpio, 0);
Copy link
Member

Choose a reason for hiding this comment

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

Usually reset should de-asserted after power is stable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sequence is from here. Should I still move it around? BTW, the reset sequence of the sis_i2c driver seems to be kind of similiar but it goes from low to high to low. Is it more correct? Besides, the downstream kernel has a "tp_vendor" GPIO. Is there a use case for it? Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

Could be that h/w auto-resets on power-on, datasheet is needed.

I think you should add GPIO hog for the "tp_vendor", probably it's an electrical requirement.

/* low: tablet, high: dock */
hpd-gpios = <&gpio TEGRA_GPIO(H, 4) GPIO_ACTIVE_LOW>;
ddc-i2c-bus = <&i2c4>;
ddc-en-gpios = <&gpio TEGRA_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
Copy link
Contributor Author

@maximschwalm maximschwalm May 24, 2022

Choose a reason for hiding this comment

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

I realized that the display-connector driver has no support for this GPIO, so this doesn't do anything. It might also be an enable GPIO for the bridge, but when I set it as such I don't get display output:
drm drm: [drm] Cannot find any crtc or sizes
Then it falls back to 1024x768 mode and I just see the backlight.

Copy link
Member

Choose a reason for hiding this comment

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

@maximschwalm Will you you be able to clarify that GPIO?

Copy link
Contributor Author

@maximschwalm maximschwalm Jun 12, 2022

Choose a reason for hiding this comment

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

The GPIO is referred to as EN_VDD_BL also scalar_enable in the P1802 kernel. If I manually toggle the GPIO via sysfs, I can power on/off the display. BTW, the screen shows a text when powering on, saying "Pad Mode" for a second.

Copy link

Choose a reason for hiding this comment

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

this sounds like the same as using the magic button . if i press it when docked i get the text : "dock mode" and "pad mode" when pressed again. if the pad is undocked the button wont work. when you toggle it you maybe putting the pad i "docked mode"

@clamor-s
Copy link
Contributor

clamor-s commented Jun 2, 2022

@digetx may you remove transformers branch? Those changes are in mainline already

@digetx
Copy link
Member

digetx commented Jun 2, 2022

Removed

if (!data)
return -ENOMEM;

data->reset_gpio = devm_gpiod_get_optional(dev,"reset", GPIOD_OUT_HIGH);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: whitespace is missing after (dev,

Copy link
Member

Choose a reason for hiding this comment

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

@maximschwalm Are you going to push update anytime soon? If not, then I can merge what we have now and we'll continue with a new PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied your suggestions except for changing the power sequence of the USB device. Is it good to go then?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, thanks!

Add a device-tree for the Asus Portable AiO P1801-T, which is a NVIDIA
Tegra30-based 2-in-1 detachable tablet, originally running Android.

The tablet was also sold together with a PC docking station as the
Transformer AiO P1801.

Tested-by: Andreas Westman Dorcsak <[email protected]> # P1801-T w/ dock
Co-developed-by: Maxim Schwalm <[email protected]>
Signed-off-by: Maxim Schwalm <[email protected]>
Signed-off-by: Svyatoslav Ryhel <[email protected]>
@digetx digetx merged commit 999564e into grate-driver:master Jun 17, 2022
okias pushed a commit to okias/linux that referenced this pull request Jan 11, 2024
Like commit 1cf3bfc ("bpf: Support 64-bit pointers to kfuncs")
for s390x, add support for 64-bit pointers to kfuncs for LoongArch.
Since the infrastructure is already implemented in BPF core, the only
thing need to be done is to override bpf_jit_supports_far_kfunc_call().

Before this change, several test_verifier tests failed:

  # ./test_verifier | grep # | grep FAIL
  grate-driver#119/p calls: invalid kfunc call: ptr_to_mem to struct with non-scalar FAIL
  grate-driver#120/p calls: invalid kfunc call: ptr_to_mem to struct with nesting depth > 4 FAIL
  grate-driver#121/p calls: invalid kfunc call: ptr_to_mem to struct with FAM FAIL
  grate-driver#122/p calls: invalid kfunc call: reg->type != PTR_TO_CTX FAIL
  grate-driver#123/p calls: invalid kfunc call: void * not allowed in func proto without mem size arg FAIL
  grate-driver#124/p calls: trigger reg2btf_ids[reg->type] for reg->type > __BPF_REG_TYPE_MAX FAIL
  grate-driver#125/p calls: invalid kfunc call: reg->off must be zero when passed to release kfunc FAIL
  grate-driver#126/p calls: invalid kfunc call: don't match first member type when passed to release kfunc FAIL
  grate-driver#127/p calls: invalid kfunc call: PTR_TO_BTF_ID with negative offset FAIL
  grate-driver#128/p calls: invalid kfunc call: PTR_TO_BTF_ID with variable offset FAIL
  grate-driver#129/p calls: invalid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  grate-driver#130/p calls: valid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  #486/p map_kptr: ref: reference state created and released on xchg FAIL

This is because the kfuncs in the loaded module are far away from
__bpf_call_base:

  ffff800002009440 t bpf_kfunc_call_test_fail1    [bpf_testmod]
  9000000002e128d8 T __bpf_call_base

The offset relative to __bpf_call_base does NOT fit in s32, which breaks
the assumption in BPF core. Enable bpf_jit_supports_far_kfunc_call() lifts
this limit.

Note that to reproduce the above result, tools/testing/selftests/bpf/config
should be applied, and run the test with JIT enabled, unpriv BPF enabled.

With this change, the test_verifier tests now all passed:

  # ./test_verifier
  ...
  Summary: 777 PASSED, 0 SKIPPED, 0 FAILED

Tested-by: Tiezhu Yang <[email protected]>
Signed-off-by: Hengqi Chen <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants