qcom: add clk-pwm support and fix Ethernet and RS-485 handling - #590
Open
RadxaSongjun wants to merge 5 commits into
Open
qcom: add clk-pwm support and fix Ethernet and RS-485 handling#590RadxaSongjun wants to merge 5 commits into
RadxaSongjun wants to merge 5 commits into
Conversation
Clock outputs do not guarantee a defined pin level when the clock is disabled, and some clock providers cannot represent exact 0% or 100% duty cycles. Add optional GPIO and pinctrl support. Use the GPIO to drive constant levels when the PWM is disabled or configured for 0% or 100% duty cycle, and select the clock function for normal PWM output. Link: radxa@8975042 Signed-off-by: Xilin Wu <sophon@radxa.com> Signed-off-by: Songjun Li <lisongjun@radxa.com>
The SA8775P GP clock frequency table only provides 100 MHz and 200 MHz rates, which cannot satisfy low-frequency PWM consumers. Add 1, 5, 10, 20 and 100 kHz configurations derived from the 19.2 MHz TCXO. Use clk_rcg2_ops for the GP clock sources so clk-pwm can configure the output duty cycle. The 10 kHz and 20 kHz rates are used by the VMARC-Q9075 fan and display backlight respectively. Signed-off-by: Songjun Li <lisongjun@radxa.com>
Signed-off-by: Songjun Li <lisongjun@radxa.com>
Switching between 1Gbps and 2.5Gbps can leave the QCOM ETHQOS MAC and PCS in a state where the PHY ID cannot be read and the link cannot be restored. Track the previously configured link speed and request an adapter reset when the speed changes to or from 2.5Gbps. Skip the reset for the initial link setup. Expose stmmac_request_reset() so the platform driver can schedule the existing stmmac service-task reset instead of resetting the device directly from the MAC link-up callback. This restores link operation across 1Gbps and 2.5Gbps transitions. Signed-off-by: Songjun Li <lisongjun@radxa.com>
The RS-485 configuration callback forces RTS to a fixed level when RS-485 mode is enabled. This ignores SER_RS485_RTS_AFTER_SEND and can leave the transceiver in transmit mode while the bus is idle. Initialize RTS according to SER_RS485_RTS_AFTER_SEND when RS-485 mode is enabled. Reapply the configured idle level during startup so the state is restored after port setup or power cycles. Signed-off-by: Songjun Li <lisongjun@radxa.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds clock-based PWM support for SA8775P/QCS9075 and includes
fixes for Ethernet speed transitions and GENI UART RS-485 operation.