Skip to content

Commit

Permalink
Merge tag 'phy-for-6.14' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/phy/linux-phy

Pull phy updates from Vinod Koul:
 "Lots of Qualcomm and Rockchip device support.

  New Support:
   - Qualcomm SAR2130P qmp usb, SAR2130P qmp pcie, QCS615 qusb2 and
     PCIe, IPQ5424 qmp pcie, IPQ5424 QUSB2 and USB3 PHY
   - Rockchip rk3576 combo phy support

  Updates:
   - Drop Shengyang for JH7110 maintainer
   - Freescale hdmi register calculation optimization
   - Rockchip pcie phy mutex and regmap updates"

* tag 'phy-for-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (37 commits)
  dt-bindings: phy: qcom,qmp-pcie: document the SM8350 two lanes PCIe PHY
  phy: rockchip: phy-rockchip-typec: Fix Copyright description
  dt-bindings: phy: qcom,ipq8074-qmp-pcie: Document the IPQ5424 QMP PCIe PHYs
  phy: qcom-qusb2: Add support for QCS615
  dt-bindings: usb: qcom,dwc3: Add QCS615 to USB DWC3 bindings
  phy: core: Simplify API of_phy_simple_xlate() implementation
  phy: sun4i-usb: Remove unused of_gpio.h
  phy: HiSilicon: Don't use "proxy" headers
  phy: samsung-ufs: switch back to syscon_regmap_lookup_by_phandle()
  phy: qualcomm: qmp-pcie: add support for SAR2130P
  phy: qualcomm: qmp-pcie: define several new registers
  phy: qualcomm: qmp-pcie: split PCS_LANE1 region
  phy: qualcomm: qmp-combo: add support for SAR2130P
  dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: Add SAR2130P compatible
  dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Add SAR2130P compatible
  phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation
  phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found
  phy: freescale: fsl-samsung-hdmi: Expand Integer divider range
  phy: rockchip-naneng-combo: add rk3576 support
  dt-bindings: phy: rockchip: add rk3576 compatible
  ...
  • Loading branch information
torvalds committed Jan 29, 2025
2 parents 7c775c6 + af1bc0e commit 9f10e7f
Show file tree
Hide file tree
Showing 32 changed files with 922 additions and 171 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ properties:
compatible:
enum:
- rockchip,rk3568-naneng-combphy
- rockchip,rk3576-naneng-combphy
- rockchip,rk3588-naneng-combphy

reg:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@ description:

properties:
compatible:
enum:
- qcom,ipq6018-qmp-pcie-phy
- qcom,ipq8074-qmp-gen3-pcie-phy
- qcom,ipq8074-qmp-pcie-phy
- qcom,ipq9574-qmp-gen3x1-pcie-phy
- qcom,ipq9574-qmp-gen3x2-pcie-phy
oneOf:
- enum:
- qcom,ipq6018-qmp-pcie-phy
- qcom,ipq8074-qmp-gen3-pcie-phy
- qcom,ipq8074-qmp-pcie-phy
- qcom,ipq9574-qmp-gen3x1-pcie-phy
- qcom,ipq9574-qmp-gen3x2-pcie-phy
- items:
- enum:
- qcom,ipq5424-qmp-gen3x1-pcie-phy
- const: qcom,ipq9574-qmp-gen3x1-pcie-phy
- items:
- enum:
- qcom,ipq5424-qmp-gen3x2-pcie-phy
- const: qcom,ipq9574-qmp-gen3x2-pcie-phy

reg:
items:
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ properties:
oneOf:
- items:
- enum:
- qcom,ipq5424-qusb2-phy
- qcom,ipq6018-qusb2-phy
- qcom,ipq8074-qusb2-phy
- qcom,ipq9574-qusb2-phy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ description:
properties:
compatible:
enum:
- qcom,qcs615-qmp-gen3x1-pcie-phy
- qcom,sa8775p-qmp-gen4x2-pcie-phy
- qcom,sa8775p-qmp-gen4x4-pcie-phy
- qcom,sar2130p-qmp-gen3x2-pcie-phy
- qcom,sc8180x-qmp-pcie-phy
- qcom,sc8280xp-qmp-gen3x1-pcie-phy
- qcom,sc8280xp-qmp-gen3x2-pcie-phy
Expand All @@ -32,6 +34,7 @@ properties:
- qcom,sm8250-qmp-gen3x2-pcie-phy
- qcom,sm8250-qmp-modem-pcie-phy
- qcom,sm8350-qmp-gen3x1-pcie-phy
- qcom,sm8350-qmp-gen3x2-pcie-phy
- qcom,sm8450-qmp-gen3x1-pcie-phy
- qcom,sm8450-qmp-gen4x2-pcie-phy
- qcom,sm8550-qmp-gen3x2-pcie-phy
Expand Down Expand Up @@ -139,6 +142,7 @@ allOf:
compatible:
contains:
enum:
- qcom,sar2130p-qmp-gen3x2-pcie-phy
- qcom,sc8180x-qmp-pcie-phy
- qcom,sdm845-qhp-pcie-phy
- qcom,sdm845-qmp-pcie-phy
Expand All @@ -149,6 +153,7 @@ allOf:
- qcom,sm8250-qmp-gen3x2-pcie-phy
- qcom,sm8250-qmp-modem-pcie-phy
- qcom,sm8350-qmp-gen3x1-pcie-phy
- qcom,sm8350-qmp-gen3x2-pcie-phy
- qcom,sm8450-qmp-gen3x1-pcie-phy
- qcom,sm8450-qmp-gen3x2-pcie-phy
- qcom,sm8550-qmp-gen3x2-pcie-phy
Expand All @@ -167,6 +172,7 @@ allOf:
compatible:
contains:
enum:
- qcom,qcs615-qmp-gen3x1-pcie-phy
- qcom,sc8280xp-qmp-gen3x1-pcie-phy
- qcom,sc8280xp-qmp-gen3x2-pcie-phy
- qcom,sc8280xp-qmp-gen3x4-pcie-phy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description:
properties:
compatible:
enum:
- qcom,ipq5424-qmp-usb3-phy
- qcom,ipq6018-qmp-usb3-phy
- qcom,ipq8074-qmp-usb3-phy
- qcom,ipq9574-qmp-usb3-phy
Expand Down Expand Up @@ -89,6 +90,7 @@ allOf:
compatible:
contains:
enum:
- qcom,ipq5424-qmp-usb3-phy
- qcom,ipq6018-qmp-usb3-phy
- qcom,ipq8074-qmp-usb3-phy
- qcom,ipq9574-qmp-usb3-phy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description:
properties:
compatible:
enum:
- qcom,sar2130p-qmp-usb3-dp-phy
- qcom,sc7180-qmp-usb3-dp-phy
- qcom,sc7280-qmp-usb3-dp-phy
- qcom,sc8180x-qmp-usb3-dp-phy
Expand Down Expand Up @@ -127,6 +128,7 @@ allOf:
properties:
compatible:
enum:
- qcom,sar2130p-qmp-usb3-dp-phy
- qcom,sc8280xp-qmp-usb43dp-phy
- qcom,sm6350-qmp-usb3-dp-phy
- qcom,sm8550-qmp-usb3-dp-phy
Expand Down
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -22507,7 +22507,6 @@ F: drivers/phy/starfive/phy-jh7110-dphy-rx.c

STARFIVE JH7110 DPHY TX DRIVER
M: Keith Zhao <[email protected]>
M: Shengyang Chen <[email protected]>
S: Supported
F: Documentation/devicetree/bindings/phy/starfive,jh7110-dphy-tx.yaml
F: drivers/phy/starfive/phy-jh7110-dphy-tx.c
Expand Down
1 change: 0 additions & 1 deletion drivers/phy/allwinner/phy-sun4i-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/phy/phy.h>
#include <linux/phy/phy-sun4i-usb.h>
#include <linux/platform_device.h>
Expand Down
49 changes: 21 additions & 28 deletions drivers/phy/freescale/phy-fsl-samsung-hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,25 +331,17 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
{
u32 pclk = cfg->pixclk;
u32 fld_tg_code;
u32 pclk_khz;
u8 div = 1;

switch (cfg->pixclk) {
case 22250000 ... 47500000:
div = 1;
break;
case 50349650 ... 99000000:
div = 2;
break;
case 100699300 ... 198000000:
div = 4;
break;
case 205000000 ... 297000000:
div = 8;
break;
u32 int_pllclk;
u8 div;

/* Find int_pllclk speed */
for (div = 0; div < 4; div++) {
int_pllclk = pclk / (1 << div);
if (int_pllclk < (50 * MHZ))
break;
}

writeb(FIELD_PREP(REG12_CK_DIV_MASK, ilog2(div)), phy->regs + PHY_REG(12));
writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));

/*
* Calculation for the frequency lock detector target code (fld_tg_code)
Expand All @@ -362,10 +354,8 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
* settings rounding up always too. TODO: Check if that is
* correct.
*/
pclk /= div;
pclk_khz = pclk / 1000;
fld_tg_code = 256 * 1000 * 1000 / pclk_khz * 24;
fld_tg_code = DIV_ROUND_UP(fld_tg_code, 1000);

fld_tg_code = DIV_ROUND_UP(24 * MHZ * 256, int_pllclk);

/* FLD_TOL and FLD_RP_CODE taken from downstream driver */
writeb(FIELD_PREP(REG13_TG_CODE_LOW_MASK, fld_tg_code),
Expand Down Expand Up @@ -406,16 +396,15 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
continue;

/*
* TODO: Ref Manual doesn't state the range of _m
* so this should be further refined if possible.
* This range was set based on the original values
* in the lookup table
* The Ref manual doesn't explicitly state the range of M,
* but it does show it as an 8-bit value, so reject
* any value above 255.
*/
tmp = (u64)fout * (_p * _s);
do_div(tmp, 24 * MHZ);
_m = tmp;
if (_m < 0x30 || _m > 0x7b)
if (tmp > 255)
continue;
_m = tmp;

/*
* Rev 2 of the Ref Manual states the
Expand All @@ -440,9 +429,13 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
min_delta = delta;
best_freq = tmp;
}

/* If we have an exact match, stop looking for a better value */
if (!delta)
goto done;
}
}

done:
if (best_freq) {
*p = best_p;
*m = best_m;
Expand Down
11 changes: 8 additions & 3 deletions drivers/phy/hisilicon/phy-hi3670-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@
*/

#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of_gpio.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/types.h>

#define AXI_CLK_FREQ 207500000
#define REF_CLK_FREQ 100000000
Expand Down
2 changes: 1 addition & 1 deletion drivers/phy/marvell/phy-mvebu-cp110-comphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static int mvebu_comphy_ethernet_init_reset(struct mvebu_comphy_lane *lane)
/* wait until clocks are ready */
mdelay(1);

/* exlicitly disable 40B, the bits isn't clear on reset */
/* explicitly disable 40B, the bits isn't clear on reset */
regmap_read(priv->regmap, MVEBU_COMPHY_CONF6(lane->id), &val);
val &= ~MVEBU_COMPHY_CONF6_40B;
regmap_write(priv->regmap, MVEBU_COMPHY_CONF6(lane->id), val);
Expand Down
44 changes: 44 additions & 0 deletions drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <linux/module.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#include <linux/types.h>
#include <linux/units.h>
#include <linux/nvmem-consumer.h>
Expand Down Expand Up @@ -478,8 +480,50 @@ static int mtk_hdmi_phy_configure(struct phy *phy, union phy_configure_opts *opt
return ret;
}

static int mtk_hdmi_phy_pwr5v_enable(struct regulator_dev *rdev)
{
struct mtk_hdmi_phy *hdmi_phy = rdev_get_drvdata(rdev);

mtk_phy_set_bits(hdmi_phy->regs + HDMI_CTL_1, RG_HDMITX_PWR5V_O);

return 0;
}

static int mtk_hdmi_phy_pwr5v_disable(struct regulator_dev *rdev)
{
struct mtk_hdmi_phy *hdmi_phy = rdev_get_drvdata(rdev);

mtk_phy_clear_bits(hdmi_phy->regs + HDMI_CTL_1, RG_HDMITX_PWR5V_O);

return 0;
}

static int mtk_hdmi_phy_pwr5v_is_enabled(struct regulator_dev *rdev)
{
struct mtk_hdmi_phy *hdmi_phy = rdev_get_drvdata(rdev);

return !!(readl(hdmi_phy->regs + HDMI_CTL_1) & RG_HDMITX_PWR5V_O);
}

static const struct regulator_ops mtk_hdmi_pwr5v_regulator_ops = {
.enable = mtk_hdmi_phy_pwr5v_enable,
.disable = mtk_hdmi_phy_pwr5v_disable,
.is_enabled = mtk_hdmi_phy_pwr5v_is_enabled
};

static const struct regulator_desc mtk_hdmi_phy_pwr5v_desc = {
.name = "hdmi-pwr5v",
.id = -1,
.n_voltages = 1,
.fixed_uV = 5000000,
.ops = &mtk_hdmi_pwr5v_regulator_ops,
.type = REGULATOR_VOLTAGE,
.owner = THIS_MODULE,
};

struct mtk_hdmi_phy_conf mtk_hdmi_phy_8195_conf = {
.flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_GATE,
.hdmi_phy_regulator_desc = &mtk_hdmi_phy_pwr5v_desc,
.hdmi_phy_clk_ops = &mtk_hdmi_pll_ops,
.hdmi_phy_enable_tmds = mtk_hdmi_phy_enable_tmds,
.hdmi_phy_disable_tmds = mtk_hdmi_phy_disable_tmds,
Expand Down
3 changes: 3 additions & 0 deletions drivers/phy/mediatek/phy-mtk-hdmi-mt8195.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
#define HDMI_ANA_CTL 0x7c
#define REG_ANA_HDMI20_FIFO_EN BIT(16)

#define HDMI_CTL_1 0xc4
#define RG_HDMITX_PWR5V_O BIT(9)

#define HDMI_CTL_3 0xcc
#define REG_HDMITXPLL_DIV GENMASK(4, 0)
#define REG_HDMITX_REF_XTAL_SEL BIT(7)
Expand Down
28 changes: 28 additions & 0 deletions drivers/phy/mediatek/phy-mtk-hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ static void mtk_hdmi_phy_clk_get_data(struct mtk_hdmi_phy *hdmi_phy,
clk_init->ops = hdmi_phy->conf->hdmi_phy_clk_ops;
}

static int mtk_hdmi_phy_register_regulators(struct mtk_hdmi_phy *hdmi_phy)
{
const struct regulator_desc *vreg_desc = hdmi_phy->conf->hdmi_phy_regulator_desc;
const struct regulator_init_data vreg_init_data = {
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
}
};
struct regulator_config vreg_config = {
.dev = hdmi_phy->dev,
.driver_data = hdmi_phy,
.init_data = &vreg_init_data,
.of_node = hdmi_phy->dev->of_node
};

hdmi_phy->rdev = devm_regulator_register(hdmi_phy->dev, vreg_desc, &vreg_config);
if (IS_ERR(hdmi_phy->rdev))
return PTR_ERR(hdmi_phy->rdev);

return 0;
}

static int mtk_hdmi_phy_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand Down Expand Up @@ -150,6 +172,12 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
if (hdmi_phy->conf->pll_default_off)
hdmi_phy->conf->hdmi_phy_disable_tmds(hdmi_phy);

if (hdmi_phy->conf->hdmi_phy_regulator_desc) {
ret = mtk_hdmi_phy_register_regulators(hdmi_phy);
if (ret)
return ret;
}

return of_clk_add_provider(dev->of_node, of_clk_src_simple_get,
hdmi_phy->pll);
}
Expand Down
4 changes: 4 additions & 0 deletions drivers/phy/mediatek/phy-mtk-hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
#include <linux/module.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/types.h>

struct mtk_hdmi_phy;

struct mtk_hdmi_phy_conf {
unsigned long flags;
bool pll_default_off;
const struct regulator_desc *hdmi_phy_regulator_desc;
const struct clk_ops *hdmi_phy_clk_ops;
void (*hdmi_phy_enable_tmds)(struct mtk_hdmi_phy *hdmi_phy);
void (*hdmi_phy_disable_tmds)(struct mtk_hdmi_phy *hdmi_phy);
Expand All @@ -32,6 +35,7 @@ struct mtk_hdmi_phy {
struct mtk_hdmi_phy_conf *conf;
struct clk *pll;
struct clk_hw pll_hw;
struct regulator_dev *rdev;
unsigned long pll_rate;
unsigned char drv_imp_clk;
unsigned char drv_imp_d2;
Expand Down
Loading

0 comments on commit 9f10e7f

Please sign in to comment.