|
@@ -42,6 +42,12 @@ enum phy_mode {
|
|
|
PHY_MODE_MIPI_DPHY,
|
|
PHY_MODE_MIPI_DPHY,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * union phy_configure_opts - Opaque generic phy configuration
|
|
|
|
|
+ */
|
|
|
|
|
+union phy_configure_opts {
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* struct phy_ops - set of function pointers for performing phy operations
|
|
* struct phy_ops - set of function pointers for performing phy operations
|
|
|
* @init: operation to be performed for initializing phy
|
|
* @init: operation to be performed for initializing phy
|
|
@@ -60,6 +66,37 @@ struct phy_ops {
|
|
|
int (*power_on)(struct phy *phy);
|
|
int (*power_on)(struct phy *phy);
|
|
|
int (*power_off)(struct phy *phy);
|
|
int (*power_off)(struct phy *phy);
|
|
|
int (*set_mode)(struct phy *phy, enum phy_mode mode, int submode);
|
|
int (*set_mode)(struct phy *phy, enum phy_mode mode, int submode);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @configure:
|
|
|
|
|
+ *
|
|
|
|
|
+ * Optional.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Used to change the PHY parameters. phy_init() must have
|
|
|
|
|
+ * been called on the phy.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns: 0 if successful, an negative error code otherwise
|
|
|
|
|
+ */
|
|
|
|
|
+ int (*configure)(struct phy *phy, union phy_configure_opts *opts);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @validate:
|
|
|
|
|
+ *
|
|
|
|
|
+ * Optional.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Used to check that the current set of parameters can be
|
|
|
|
|
+ * handled by the phy. Implementations are free to tune the
|
|
|
|
|
+ * parameters passed as arguments if needed by some
|
|
|
|
|
+ * implementation detail or constraints. It must not change
|
|
|
|
|
+ * any actual configuration of the PHY, so calling it as many
|
|
|
|
|
+ * times as deemed fit by the consumer must have no side
|
|
|
|
|
+ * effect.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns: 0 if the configuration can be applied, an negative
|
|
|
|
|
+ * error code otherwise
|
|
|
|
|
+ */
|
|
|
|
|
+ int (*validate)(struct phy *phy, enum phy_mode mode, int submode,
|
|
|
|
|
+ union phy_configure_opts *opts);
|
|
|
int (*reset)(struct phy *phy);
|
|
int (*reset)(struct phy *phy);
|
|
|
int (*calibrate)(struct phy *phy);
|
|
int (*calibrate)(struct phy *phy);
|
|
|
void (*release)(struct phy *phy);
|
|
void (*release)(struct phy *phy);
|
|
@@ -167,6 +204,9 @@ int phy_power_off(struct phy *phy);
|
|
|
int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode);
|
|
int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode);
|
|
|
#define phy_set_mode(phy, mode) \
|
|
#define phy_set_mode(phy, mode) \
|
|
|
phy_set_mode_ext(phy, mode, 0)
|
|
phy_set_mode_ext(phy, mode, 0)
|
|
|
|
|
+int phy_configure(struct phy *phy, union phy_configure_opts *opts);
|
|
|
|
|
+int phy_validate(struct phy *phy, enum phy_mode mode, int submode,
|
|
|
|
|
+ union phy_configure_opts *opts);
|
|
|
|
|
|
|
|
static inline enum phy_mode phy_get_mode(struct phy *phy)
|
|
static inline enum phy_mode phy_get_mode(struct phy *phy)
|
|
|
{
|
|
{
|
|
@@ -311,6 +351,24 @@ static inline int phy_calibrate(struct phy *phy)
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static inline int phy_configure(struct phy *phy,
|
|
|
|
|
+ union phy_configure_opts *opts)
|
|
|
|
|
+{
|
|
|
|
|
+ if (!phy)
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+ return -ENOSYS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline int phy_validate(struct phy *phy, enum phy_mode mode, int submode,
|
|
|
|
|
+ union phy_configure_opts *opts)
|
|
|
|
|
+{
|
|
|
|
|
+ if (!phy)
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+ return -ENOSYS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static inline int phy_get_bus_width(struct phy *phy)
|
|
static inline int phy_get_bus_width(struct phy *phy)
|
|
|
{
|
|
{
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|