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

Driver sitronix CF1133 controller touchscreen #68321

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

clemdy
Copy link
Contributor

@clemdy clemdy commented Jan 31, 2024

Add a new out of tree driver that support sitronix CF1133 controller touchscreen (I2C). Can be multitouch if needed.

Clément Dysli / clementdy@kickmaker.net

Fixes #68306

@zephyrbot zephyrbot added area: Input Input Subsystem and Drivers area: Devicetree Binding PR modifies or adds a Device Tree binding labels Jan 31, 2024
Copy link

Hello @clemdy, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
dts/bindings/input/sitronix,cf1133.yaml Outdated Show resolved Hide resolved
drivers/input/CMakeLists.txt Outdated Show resolved Hide resolved
drivers/input/Kconfig.cf1133 Outdated Show resolved Hide resolved
@clemdy clemdy force-pushed the main branch 3 times, most recently from 4a17f25 to 36b66aa Compare January 31, 2024 11:14
@clemdy clemdy requested a review from nordicjm January 31, 2024 12:08
@nordicjm
Copy link
Collaborator

Seems your email is not setup in git properly, try:

git config --global user.name "Clement Dysli"
git config --global user.email "clementdy@kickmaker.net"
git commit --amend --reset-author
git push --force

@clemdy
Copy link
Contributor Author

clemdy commented Jan 31, 2024

Yes my author name in the commit was bad i've corrected it

@nordicjm nordicjm dismissed their stale review January 31, 2024 12:51

Queries addressed

Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Hi, initial round of comment, mostly styling things, thanks!

dts/bindings/input/sitronix,cf1133.yaml Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved

gpio_init_callback(&(data->int_gpio_cb), cf1133_isr_handler, BIT(config->int_gpio.pin));

r = gpio_add_callback(config->int_gpio.port, &(data->int_gpio_cb));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
r = gpio_add_callback(config->int_gpio.port, &(data->int_gpio_cb));
r = gpio_add_callback(config->int_gpio.port, &data->int_gpio_cb);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK done


if INPUT_CF1133

config INPUT_CF1133_PERIOD
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
config INPUT_CF1133_PERIOD
config INPUT_CF1133_PERIOD_MS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK done

drivers/input/Kconfig.cf1133 Outdated Show resolved Hide resolved
Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Thanks, few more comments, also could you add this to https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/build_all/input/app.overlay#L185 so it gets built in CI?

drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
@clemdy
Copy link
Contributor Author

clemdy commented Feb 1, 2024

By the way, thank you very much Fabio for you advices and patience ;-)

@clemdy clemdy requested a review from fabiobaltieri February 5, 2024 08:16
@clemdy clemdy force-pushed the main branch 3 times, most recently from e703433 to 46470c7 Compare February 6, 2024 12:12
@fabiobaltieri
Copy link
Member

By the way, thank you very much Fabio for you advices and patience ;-)

Hey, you bet! Keep an eye out for compliance errors, since this is your first PR for the project we have to approve the run manually for every push but you can also run it locally using ./scripts/ci/check_compliance.py, saves you waiting for us to pick it up. After the first is PR is merged they'll just run automatically.

@clemdy
Copy link
Contributor Author

clemdy commented Feb 6, 2024

By the way, thank you very much Fabio for you advices and patience ;-)

Hey, you bet! Keep an eye out for compliance errors, since this is your first PR for the project we have to approve the run manually for every push but you can also run it locally using ./scripts/ci/check_compliance.py, saves you waiting for us to pick it up. After the first is PR is merged they'll just run automatically.

Hey i think i have it, my tab size was 4 in my code editor instead of 8 by default for Gitlab that's why i have those issues. ^^

Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Cool, one more round of comments, mostly styling related.

tests/drivers/build_all/input/app.overlay Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Show resolved Hide resolved
@fabiobaltieri
Copy link
Member

@danieldegrasse can you do another review pass?

@fabiobaltieri
Copy link
Member

fabiobaltieri commented Mar 6, 2024

@clemdy sorry this needs a rebase now, could you rebase and force push again please? You'll probably have to tweak the address in the i2c tests as well. Thanks for your patience.

@fabiobaltieri
Copy link
Member

@clemdy sorry we don't take merge commits, just rebase it so there's a single commit on top of the current main.

@clemdy clemdy force-pushed the main branch 2 times, most recently from de33716 to acc443f Compare March 6, 2024 18:27
fabiobaltieri
fabiobaltieri previously approved these changes Mar 6, 2024
faxe1008
faxe1008 previously approved these changes Mar 6, 2024
Copy link
Collaborator

@faxe1008 faxe1008 left a comment

Choose a reason for hiding this comment

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

Only found some stylistic inconsistencies. Good stuff 👍

return 0;
}

static int cf1133_get_protocol_type(struct cf1133_data *data, const struct cf1133_config *config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe its a preference thing, but there are some methods that take the deconstructed data and config and some take the entire device.

Copy link
Member

@fabiobaltieri fabiobaltieri Mar 23, 2024

Choose a reason for hiding this comment

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

@clemdy I would recommend just passing dev to all internal functions and then get data and config internally, there's no performance penalties (the compiler optimizes all the pointer arithmetic out I think), you save a tiny bit of stack (only on pointer to pass) and you don't have to update the function signature if you need more stuff. I see at a bit like a self of Zephyr drivers.

drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
dts/bindings/input/sitronix,cf1133.yaml Show resolved Hide resolved
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

Updating the Kconfig help field is important IMO as it can lead to a non trivial build error

drivers/input/Kconfig.cf1133 Show resolved Hide resolved
drivers/input/input_cf1133.c Outdated Show resolved Hide resolved
@clemdy clemdy dismissed stale reviews from faxe1008 and fabiobaltieri via 07abc73 March 22, 2024 14:51
@clemdy clemdy force-pushed the main branch 3 times, most recently from 87978a9 to 9d71a4d Compare March 22, 2024 16:09
@fabiobaltieri
Copy link
Member

@clemdy there's a build error, plus I think one unaddressed stylistic comment (that I very much agree with). Thanks for your patience!

The driver allows to use CF1133 controller touchscreen (I2C)

Signed-off-by: Clement Dysli <clementdy@kickmaker.net>
@clemdy
Copy link
Contributor Author

clemdy commented Mar 25, 2024

Sorry @fabiobaltieri didn't want to re request your review i was aiming for @bjarki-trackunit (my page didn't refresh fast enough)

@clemdy clemdy requested a review from nordicjm March 26, 2024 08:36
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

Looks good :)

@fabiobaltieri fabiobaltieri merged commit bc140e1 into zephyrproject-rtos:main Mar 26, 2024
21 checks passed
Copy link

Hi @clemdy!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Input Input Subsystem and Drivers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add driver that support cf1133 touchscreen controller from Sitronix
7 participants