-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.6-y] [CIX] Apply syscon, gpio and phy suppors for CIX #642
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
Closed
Avenger-285714
wants to merge
3
commits into
deepin-community:linux-6.6.y
from
Avenger-285714:linux-6.6.y
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,4 +35,5 @@ obj-y += allwinner/ \ | |
| sunplus/ \ | ||
| tegra/ \ | ||
| ti/ \ | ||
| xilinx/ | ||
| xilinx/ \ | ||
| cix/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # SPDX-License-Identifier: GPL-2.0-only | ||
| # | ||
| # Phy drivers for Cix PHYs | ||
| # | ||
|
|
||
| config PHY_CIX_USBDP | ||
| tristate "Cix USBDP PHY Driver" | ||
| depends on OF && HAS_IOMEM | ||
| select GENERIC_PHY | ||
| help | ||
| Enable this to support the CIX USBDP PHY for TYPEC Connection | ||
|
|
||
| config PHY_CIX_USB2 | ||
| tristate "Cix USB2 PHY Driver" | ||
| depends on OF | ||
| select GENERIC_PHY | ||
| help | ||
| Enable this to support the CIX USB2 PHY | ||
|
|
||
| config PHY_CIX_USB3 | ||
| tristate "Cix USB3 PHY Driver" | ||
| depends on OF && HAS_IOMEM | ||
| select GENERIC_PHY | ||
| help | ||
| Enable this to support the CIX USB3 PHY for TYPEA Connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # SPDX-License-Identifier: GPL-2.0-only | ||
| obj-$(CONFIG_PHY_CIX_USBDP) += phy-cix-usbdp.o | ||
| obj-$(CONFIG_PHY_CIX_USB2) += phy-cix-usb2.o | ||
| obj-$(CONFIG_PHY_CIX_USB3) += phy-cix-usb3.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // SPDX-License-Identifier: GPL-2.0 | ||
| /* | ||
| * phy driver for cdn_usb2_p_sd10000 | ||
| */ | ||
| #include <linux/acpi.h> | ||
| #include <linux/reset.h> | ||
| #include <linux/kernel.h> | ||
| #include <linux/of_platform.h> | ||
|
|
||
| static const struct acpi_device_id cix_usb2phy_acpi_match[] = { | ||
| { "CIXH2032" }, | ||
| { }, | ||
| }; | ||
| MODULE_DEVICE_TABLE(acpi, cix_usb2phy_acpi_match); | ||
|
|
||
| static const struct of_device_id cix_usb2phy_dt_match[] = { | ||
| { | ||
| .compatible = "cix,sky1-usb2-phy", | ||
| .data = NULL | ||
| }, | ||
| { /* sentinel */ } | ||
| }; | ||
|
|
||
| MODULE_DEVICE_TABLE(of, cix_usb2phy_dt_match); | ||
|
|
||
| static int cix_usb2phy_probe(struct platform_device *pdev) | ||
| { | ||
| struct device *dev = &pdev->dev; | ||
| struct reset_control *preset; | ||
|
|
||
| preset = devm_reset_control_get(dev, "preset"); | ||
|
|
||
| if (IS_ERR(preset)) | ||
| dev_err(dev, "%s: failed to get preset\n", __func__); | ||
| else | ||
| reset_control_deassert(preset); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| static struct platform_driver cix_usb2phy_driver = { | ||
| .probe = cix_usb2phy_probe, | ||
| .driver = { | ||
| .name = "cix,sky1-usb2-phy", | ||
| .of_match_table = cix_usb2phy_dt_match, | ||
| .acpi_match_table = cix_usb2phy_acpi_match, | ||
| .pm = NULL, | ||
| }, | ||
| }; | ||
|
|
||
| module_platform_driver(cix_usb2phy_driver); | ||
|
|
||
| MODULE_AUTHOR("Chao Zeng <[email protected]>"); | ||
| MODULE_DESCRIPTION("Cix Usb2 PHY driver"); | ||
| MODULE_LICENSE("GPL"); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Revisit error handling for missing reset control.
Currently, if obtaining the reset control fails, an error is logged but the probe continues and returns success. If the reset control is critical to proper operation, consider returning the error code (e.g., PTR_ERR(preset)) to prevent initializing in an invalid state.