Skip to content

Commit

Permalink
phy: miphy365x: Use the generic phy type constants in dt-bindings/phy…
Browse files Browse the repository at this point in the history
…/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>
  • Loading branch information
Peter Griffin authored and Kishon Vijay Abraham I committed Apr 3, 2015
1 parent 9c3b443 commit fbea230
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
8 changes: 4 additions & 4 deletions Documentation/devicetree/bindings/phy/phy-miphy365x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Required nodes : A sub-node is required for each channel the controller
Required properties (port (child) node):
- #phy-cells : Should be 1 (See second example)
Cell after port phandle is device type from:
- MIPHY_TYPE_SATA
- MIPHY_TYPE_PCI
- PHY_TYPE_SATA
- PHY_TYPE_PCI
- reg : Address and length of register sets for each device in
"reg-names"
- reg-names : The names of the register addresses corresponding to the
Expand Down Expand Up @@ -68,10 +68,10 @@ property, containing a phandle to the phy port node and a device type.

Example:

#include <dt-bindings/phy/phy-miphy365x.h>
#include <dt-bindings/phy/phy.h>

sata0: sata@fe380000 {
...
phys = <&phy_port0 MIPHY_TYPE_SATA>;
phys = <&phy_port0 PHY_TYPE_SATA>;
...
};
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/stih416.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "stih416-clock.dtsi"
#include "stih416-pinctrl.dtsi"

#include <dt-bindings/phy/phy-miphy365x.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/reset-controller/stih416-resets.h>
/ {
Expand Down Expand Up @@ -306,7 +306,7 @@
reg = <0xfe380000 0x1000>;
interrupts = <GIC_SPI 157 IRQ_TYPE_NONE>;
interrupt-names = "hostc";
phys = <&phy_port0 MIPHY_TYPE_SATA>;
phys = <&phy_port0 PHY_TYPE_SATA>;
phy-names = "sata-phy";
resets = <&powerdown STIH416_SATA0_POWERDOWN>,
<&softreset STIH416_SATA0_SOFTRESET>;
Expand Down
14 changes: 7 additions & 7 deletions drivers/phy/phy-miphy365x.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>

#include <dt-bindings/phy/phy-miphy365x.h>
#include <dt-bindings/phy/phy.h>

#define HFC_TIMEOUT 100

Expand Down Expand Up @@ -176,7 +176,7 @@ static u8 rx_tx_spd[] = {
static int miphy365x_set_path(struct miphy365x_phy *miphy_phy,
struct miphy365x_dev *miphy_dev)
{
bool sata = (miphy_phy->type == MIPHY_TYPE_SATA);
bool sata = (miphy_phy->type == PHY_TYPE_SATA);

return regmap_update_bits(miphy_dev->regmap,
miphy_phy->ctrlreg,
Expand Down Expand Up @@ -430,7 +430,7 @@ static int miphy365x_init(struct phy *phy)
}

/* Initialise Miphy for PCIe or SATA */
if (miphy_phy->type == MIPHY_TYPE_PCIE)
if (miphy_phy->type == PHY_TYPE_PCIE)
ret = miphy365x_init_pcie_port(miphy_phy, miphy_dev);
else
ret = miphy365x_init_sata_port(miphy_phy, miphy_dev);
Expand All @@ -454,8 +454,8 @@ int miphy365x_get_addr(struct device *dev, struct miphy365x_phy *miphy_phy,
return ret;
}

if (!((!strncmp(name, "sata", 4) && type == MIPHY_TYPE_SATA) ||
(!strncmp(name, "pcie", 4) && type == MIPHY_TYPE_PCIE)))
if (!((!strncmp(name, "sata", 4) && type == PHY_TYPE_SATA) ||
(!strncmp(name, "pcie", 4) && type == PHY_TYPE_PCIE)))
return 0;

miphy_phy->base = of_iomap(phynode, index);
Expand Down Expand Up @@ -498,8 +498,8 @@ static struct phy *miphy365x_xlate(struct device *dev,

miphy_phy->type = args->args[0];

if (!(miphy_phy->type == MIPHY_TYPE_SATA ||
miphy_phy->type == MIPHY_TYPE_PCIE)) {
if (!(miphy_phy->type == PHY_TYPE_SATA ||
miphy_phy->type == PHY_TYPE_PCIE)) {
dev_err(dev, "Unsupported device type: %d\n", miphy_phy->type);
return ERR_PTR(-EINVAL);
}
Expand Down
14 changes: 0 additions & 14 deletions include/dt-bindings/phy/phy-miphy365x.h

This file was deleted.

0 comments on commit fbea230

Please sign in to comment.