-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Atmel: SAM: Convert XDMAC & SSC-I2S to devicetree #24948
Conversation
All checks passed. checkpatch (informational only, not a failure)
Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
static const struct soc_gpio_pin i2s0_pins[] = { | ||
PIN_SSC0_TK, | ||
PIN_SSC0_TF, | ||
PIN_SSC0_TD, | ||
#ifdef CONFIG_I2S_SAM_SSC_0_PIN_RK_EN | ||
PIN_SSC0_RK, | ||
#endif | ||
#ifdef CONFIG_I2S_SAM_SSC_0_PIN_RF_EN | ||
PIN_SSC0_RF, | ||
#endif | ||
PIN_SSC0_RD, | ||
}; | ||
static const struct soc_gpio_pin i2s0_pins[] = ATMEL_SAM_DT_PINS(0); |
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.
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.
I underestimated the new DT generation scheme. There is no need to change the implementation. It's enough that user defines their own pinctrl-0
property for the ssc
node.
The one issue that remains is if we should provide 'default' pinctrl-0
property at the SoC level.
Atmel is a bit special, its pinmux is fairly rigid. In any given peripheral few pins, if any, can be assigned to an alternative location. But these choices exist and it feels improper to provide default configuration at the SoC level. Pin assignments are board specific and as soon as there exist a choice any default is wrong. Connecting incorrect signal to a pin can potentially damage the board.
At the same time if a peripheral doesn't allow to connect any of its pins to an alternate location forcing the user to define pinctrl-0
property at the board level also feels like an overkill.
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.
I tried to provide pinctrl-0
in the SoC dtsi files in the cases that either make sense or if there is only one option for a given peripheral. I'm find if because of how SSC is used if we want to move the pinctrl-0
setting to the board file instead.
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.
I've verified the PR with tests/drivers/i2s/*
testcases on sam_e70_xplained board (after applying #25005). One of the tests was failing, however the error is unrelated / exists also on master.
There is one more issue: this PR uses the label "SSC_0" which is consistent with the node name. However, the tests rely on old "I2S_0" label. We could handle it also in a follow up PR.
Regarding location of pinctrl-0
property, let's discuss it at the dev-review meeting since more peripherals: e.g. uart, spi are affected.
Convert sam_xdmac driver to utilize devicetree. As part of the controller binding we specify that dmas should contain a channel and the perid for the DMA transaction. Signed-off-by: Kumar Gala <[email protected]>
2e50a97
to
9346f3e
Compare
Convert i2s_sam_ssc driver to utilize devicetree. We replace Kconfig options for specifying the DMA configuration (channel, DMA device name) with getting that from devicetree. We also get pincfg from devicetree, however we still have Kconfig sybmols to specify if the RF or RK pin is enabled. Signed-off-by: Kumar Gala <[email protected]>
All pin configuration for ATMEL SAM SoC come from devicetree so we can now remove the soc_pinmap.h header files. Signed-off-by: Kumar Gala <[email protected]>
Should be updated with all the changes. Let me know if there's anything I missed. |
No description provided.