OSDN Git Service

phy: Add configuration interface
authorMaxime Ripard <maxime.ripard@bootlin.com>
Fri, 7 Dec 2018 13:55:29 +0000 (14:55 +0100)
committerKishon Vijay Abraham I <kishon@ti.com>
Wed, 12 Dec 2018 04:31:50 +0000 (10:01 +0530)
commitaeaac93ddb28eeacc0dff9c12cb338eb1de7481d
tree9324e79bddac5a7cdff0d62582b16100f1aef2ea
parentc8457828ff481411dca4cdea944c1a0980c862e1
phy: Add configuration interface

The phy framework is only allowing to configure the power state of the PHY
using the init and power_on hooks, and their power_off and exit
counterparts.

While it works for most, simple, PHYs supported so far, some more advanced
PHYs need some configuration depending on runtime parameters. These PHYs
have been supported by a number of means already, often by using ad-hoc
drivers in their consumer drivers.

That doesn't work too well however, when a consumer device needs to deal
with multiple PHYs, or when multiple consumers need to deal with the same
PHY (a DSI driver and a CSI driver for example).

So we'll add a new interface, through two funtions, phy_validate and
phy_configure. The first one will allow to check that a current
configuration, for a given mode, is applicable. It will also allow the PHY
driver to tune the settings given as parameters as it sees fit.

phy_configure will actually apply that configuration in the phy itself.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-core.c
include/linux/phy/phy.h