mbox series

[00/16] phy: qcom-qmp: further clean ups

Message ID 20220907110728.19092-1-johan+linaro@kernel.org
Headers show
Series phy: qcom-qmp: further clean ups | expand

Message

Johan Hovold Sept. 7, 2022, 11:07 a.m. UTC
This series clean up the QMP PHY drivers somewhat after the recent
driver split.

Included are also some fixes for runtime PM not being disabled on driver
unbind.

Note that these apply on top of the qmp-pcie series posted yesterday:

	https://lore.kernel.org/all/20220906074550.4383-1-johan+linaro@kernel.org/

Johan


Johan Hovold (16):
  phy: qcom-qmp-combo: disable runtime PM on unbind
  phy: qcom-qmp-combo: drop unused defines
  phy: qcom-qmp-pcie: drop unused runtime PM implementation
  phy: qcom-qmp-pcie: drop unused defines
  phy: qcom-qmp-pcie-msm8996: drop unused runtime PM implementation
  phy: qcom-qmp-pcie-msm8996: drop unused defines
  phy: qcom-qmp-ufs: drop unused runtime PM implementation
  phy: qcom-qmp-ufs: drop unused defines
  phy: qcom-qmp-usb: disable runtime PM on unbind
  phy: qcom-qmp-usb: drop unused defines
  phy: qcom-qmp: silence noisy probe
  phy: qcom-qmp-combo: shorten function prefixes
  phy: qcom-qmp-pcie-msm8996: drop unused secondary init tables
  phy: qcom-qmp-pcie-msm8996: shorten function prefixes
  phy: qcom-qmp-ufs: shorten function prefixes
  phy: qcom-qmp-usb: shorten function prefixes

 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     | 189 ++++++++---------
 .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c  | 191 +++++-------------
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c      |  64 ------
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c       | 163 ++++-----------
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       | 143 ++++++-------
 5 files changed, 238 insertions(+), 512 deletions(-)

Comments

Dmitry Baryshkov Sept. 9, 2022, 9:21 a.m. UTC | #1
On 07/09/2022 14:07, Johan Hovold wrote:
> Drop defines and enums that are unused since the QMP driver split.
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 15 ---------------
>   1 file changed, 15 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index 9ce2ab56be4c..838f7e328b55 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -28,16 +28,11 @@
>   #define SW_RESET				BIT(0)
>   /* QPHY_POWER_DOWN_CONTROL */
>   #define SW_PWRDN				BIT(0)
> -#define REFCLK_DRV_DSBL				BIT(1)
>   /* QPHY_START_CONTROL bits */
>   #define SERDES_START				BIT(0)
>   #define PCS_START				BIT(1)
> -#define PLL_READY_GATE_EN			BIT(3)
>   /* QPHY_PCS_STATUS bit */
>   #define PHYSTATUS				BIT(6)
> -#define PHYSTATUS_4_20				BIT(7)
> -/* QPHY_PCS_READY_STATUS & QPHY_COM_PCS_READY_STATUS bit */
> -#define PCS_READY				BIT(0)

I think these defines, describing registers and bits, can go to the 
common header instead.

For the rest of the patch:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

>   
>   /* QPHY_V3_DP_COM_RESET_OVRD_CTRL register bits */
>   /* DP PHY soft reset */
> @@ -71,8 +66,6 @@
>   #define POWER_DOWN_DELAY_US_MIN			10
>   #define POWER_DOWN_DELAY_US_MAX			11
>   
> -#define MAX_PROP_NAME				32
> -
>   /* Define the assumed distance between lanes for underspecified device trees. */
>   #define QMP_PHY_LEGACY_LANE_STRIDE		0x400
>   
> @@ -115,22 +108,14 @@ struct qmp_phy_init_tbl {
>   
>   /* set of registers with offsets different per-PHY */
>   enum qphy_reg_layout {
> -	/* Common block control registers */
> -	QPHY_COM_SW_RESET,
> -	QPHY_COM_POWER_DOWN_CONTROL,
> -	QPHY_COM_START_CONTROL,
> -	QPHY_COM_PCS_READY_STATUS,
>   	/* PCS registers */
>   	QPHY_SW_RESET,
>   	QPHY_START_CTRL,
> -	QPHY_PCS_READY_STATUS,
>   	QPHY_PCS_STATUS,
>   	QPHY_PCS_AUTONOMOUS_MODE_CTRL,
>   	QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR,
>   	QPHY_PCS_LFPS_RXTERM_IRQ_STATUS,
>   	QPHY_PCS_POWER_DOWN_CONTROL,
> -	/* PCS_MISC registers */
> -	QPHY_PCS_MISC_TYPEC_CTRL,
>   	/* Keep last to ensure regs_layout arrays are properly initialized */
>   	QPHY_LAYOUT_SIZE
>   };
Dmitry Baryshkov Sept. 9, 2022, 9:36 a.m. UTC | #2
On 07/09/2022 14:07, Johan Hovold wrote:
> Drop the unused and incomplete runtime PM implementation, which was
> only used by USB PHYs before splitting the QMP driver.
> 
> Note that the runtime PM was never disabled (and state restored) on
> driver unbind.
> 
> This effectively reverts commit ac0d239936bd ("phy: qcom-qmp: Add
> support for runtime PM").
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 38 ------------------------
>   1 file changed, 38 deletions(-)
>
Dmitry Baryshkov Sept. 9, 2022, 9:46 a.m. UTC | #3
On 07/09/2022 14:07, Johan Hovold wrote:
> The driver function prefix has gotten unnecessarily long and hurts
> readability.
> 
> Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm
> Multi PHY" or similar anyway).
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 165 +++++++++++-----------
>   1 file changed, 79 insertions(+), 86 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Vinod Koul Sept. 20, 2022, 5:58 a.m. UTC | #4
On 07-09-22, 13:07, Johan Hovold wrote:
> This series clean up the QMP PHY drivers somewhat after the recent
> driver split.
> 
> Included are also some fixes for runtime PM not being disabled on driver
> unbind.

Applied, thanks