Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: miphy365x: Use the generic phy type constants in dt-bindings/phy/phy.h

Now there are generic phy type constants declared in phy.h, migrate over to
using them rather than defining our own. This change has been done as one
atomic commit to be bisectable.

Note: The values of the defines are the same, so there is no ABI breakage
with this patch.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Peter Griffin and committed by
Kishon Vijay Abraham I
fbea230e 9c3b4430

+13 -27
+4 -4
Documentation/devicetree/bindings/phy/phy-miphy365x.txt
··· 20 20 Required properties (port (child) node): 21 21 - #phy-cells : Should be 1 (See second example) 22 22 Cell after port phandle is device type from: 23 - - MIPHY_TYPE_SATA 24 - - MIPHY_TYPE_PCI 23 + - PHY_TYPE_SATA 24 + - PHY_TYPE_PCI 25 25 - reg : Address and length of register sets for each device in 26 26 "reg-names" 27 27 - reg-names : The names of the register addresses corresponding to the ··· 68 68 69 69 Example: 70 70 71 - #include <dt-bindings/phy/phy-miphy365x.h> 71 + #include <dt-bindings/phy/phy.h> 72 72 73 73 sata0: sata@fe380000 { 74 74 ... 75 - phys = <&phy_port0 MIPHY_TYPE_SATA>; 75 + phys = <&phy_port0 PHY_TYPE_SATA>; 76 76 ... 77 77 };
+2 -2
arch/arm/boot/dts/stih416.dtsi
··· 10 10 #include "stih416-clock.dtsi" 11 11 #include "stih416-pinctrl.dtsi" 12 12 13 - #include <dt-bindings/phy/phy-miphy365x.h> 13 + #include <dt-bindings/phy/phy.h> 14 14 #include <dt-bindings/interrupt-controller/arm-gic.h> 15 15 #include <dt-bindings/reset-controller/stih416-resets.h> 16 16 / { ··· 306 306 reg = <0xfe380000 0x1000>; 307 307 interrupts = <GIC_SPI 157 IRQ_TYPE_NONE>; 308 308 interrupt-names = "hostc"; 309 - phys = <&phy_port0 MIPHY_TYPE_SATA>; 309 + phys = <&phy_port0 PHY_TYPE_SATA>; 310 310 phy-names = "sata-phy"; 311 311 resets = <&powerdown STIH416_SATA0_POWERDOWN>, 312 312 <&softreset STIH416_SATA0_SOFTRESET>;
+7 -7
drivers/phy/phy-miphy365x.c
··· 25 25 #include <linux/mfd/syscon.h> 26 26 #include <linux/regmap.h> 27 27 28 - #include <dt-bindings/phy/phy-miphy365x.h> 28 + #include <dt-bindings/phy/phy.h> 29 29 30 30 #define HFC_TIMEOUT 100 31 31 ··· 176 176 static int miphy365x_set_path(struct miphy365x_phy *miphy_phy, 177 177 struct miphy365x_dev *miphy_dev) 178 178 { 179 - bool sata = (miphy_phy->type == MIPHY_TYPE_SATA); 179 + bool sata = (miphy_phy->type == PHY_TYPE_SATA); 180 180 181 181 return regmap_update_bits(miphy_dev->regmap, 182 182 miphy_phy->ctrlreg, ··· 430 430 } 431 431 432 432 /* Initialise Miphy for PCIe or SATA */ 433 - if (miphy_phy->type == MIPHY_TYPE_PCIE) 433 + if (miphy_phy->type == PHY_TYPE_PCIE) 434 434 ret = miphy365x_init_pcie_port(miphy_phy, miphy_dev); 435 435 else 436 436 ret = miphy365x_init_sata_port(miphy_phy, miphy_dev); ··· 454 454 return ret; 455 455 } 456 456 457 - if (!((!strncmp(name, "sata", 4) && type == MIPHY_TYPE_SATA) || 458 - (!strncmp(name, "pcie", 4) && type == MIPHY_TYPE_PCIE))) 457 + if (!((!strncmp(name, "sata", 4) && type == PHY_TYPE_SATA) || 458 + (!strncmp(name, "pcie", 4) && type == PHY_TYPE_PCIE))) 459 459 return 0; 460 460 461 461 miphy_phy->base = of_iomap(phynode, index); ··· 498 498 499 499 miphy_phy->type = args->args[0]; 500 500 501 - if (!(miphy_phy->type == MIPHY_TYPE_SATA || 502 - miphy_phy->type == MIPHY_TYPE_PCIE)) { 501 + if (!(miphy_phy->type == PHY_TYPE_SATA || 502 + miphy_phy->type == PHY_TYPE_PCIE)) { 503 503 dev_err(dev, "Unsupported device type: %d\n", miphy_phy->type); 504 504 return ERR_PTR(-EINVAL); 505 505 }
-14
include/dt-bindings/phy/phy-miphy365x.h
··· 1 - /* 2 - * This header provides constants for the phy framework 3 - * based on the STMicroelectronics MiPHY365x. 4 - * 5 - * Author: Lee Jones <lee.jones@linaro.org> 6 - */ 7 - #ifndef _DT_BINDINGS_PHY_MIPHY 8 - #define _DT_BINDINGS_PHY_MIPHY 9 - 10 - #define MIPHY_TYPE_SATA 1 11 - #define MIPHY_TYPE_PCIE 2 12 - #define MIPHY_TYPE_USB 3 13 - 14 - #endif /* _DT_BINDINGS_PHY_MIPHY */