Commit cf4f0f1e authored by Jiri Pirko's avatar Jiri Pirko Committed by Paolo Abeni

dpll: extend uapi by lock status error attribute

If the dpll devices goes to state "unlocked" or "holdover", it may be
caused by an error. In that case, allow user to see what the error was.
Introduce a new attribute and values it can carry.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 644c6431
...@@ -51,6 +51,40 @@ definitions: ...@@ -51,6 +51,40 @@ definitions:
if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED) dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
render-max: true render-max: true
-
type: enum
name: lock-status-error
doc: |
if previous status change was done due to a failure, this provides
information of dpll device lock status error.
Valid values for DPLL_A_LOCK_STATUS_ERROR attribute
entries:
-
name: none
doc: |
dpll device lock status was changed without any error
value: 1
-
name: undefined
doc: |
dpll device lock status was changed due to undefined error.
Driver fills this value up in case it is not able
to obtain suitable exact error type.
-
name: media-down
doc: |
dpll device lock status was changed because of associated
media got down.
This may happen for example if dpll device was previously
locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
-
name: fractional-frequency-offset-too-high
doc: |
the FFO (Fractional Frequency Offset) between the RX and TX
symbol rate on the media got too high.
This may happen for example if dpll device was previously
locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
render-max: true
- -
type: const type: const
name: temp-divider name: temp-divider
...@@ -214,6 +248,10 @@ attribute-sets: ...@@ -214,6 +248,10 @@ attribute-sets:
name: type name: type
type: u32 type: u32
enum: type enum: type
-
name: lock-status-error
type: u32
enum: lock-status-error
- -
name: pin name: pin
enum-name: dpll_a_pin enum-name: dpll_a_pin
...@@ -379,6 +417,7 @@ operations: ...@@ -379,6 +417,7 @@ operations:
- mode - mode
- mode-supported - mode-supported
- lock-status - lock-status
- lock-status-error
- temp - temp
- clock-id - clock-id
- type - type
......
...@@ -50,6 +50,35 @@ enum dpll_lock_status { ...@@ -50,6 +50,35 @@ enum dpll_lock_status {
DPLL_LOCK_STATUS_MAX = (__DPLL_LOCK_STATUS_MAX - 1) DPLL_LOCK_STATUS_MAX = (__DPLL_LOCK_STATUS_MAX - 1)
}; };
/**
* enum dpll_lock_status_error - if previous status change was done due to a
* failure, this provides information of dpll device lock status error. Valid
* values for DPLL_A_LOCK_STATUS_ERROR attribute
* @DPLL_LOCK_STATUS_ERROR_NONE: dpll device lock status was changed without
* any error
* @DPLL_LOCK_STATUS_ERROR_UNDEFINED: dpll device lock status was changed due
* to undefined error. Driver fills this value up in case it is not able to
* obtain suitable exact error type.
* @DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN: dpll device lock status was changed
* because of associated media got down. This may happen for example if dpll
* device was previously locked on an input pin of type
* PIN_TYPE_SYNCE_ETH_PORT.
* @DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH: the FFO
* (Fractional Frequency Offset) between the RX and TX symbol rate on the
* media got too high. This may happen for example if dpll device was
* previously locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
*/
enum dpll_lock_status_error {
DPLL_LOCK_STATUS_ERROR_NONE = 1,
DPLL_LOCK_STATUS_ERROR_UNDEFINED,
DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN,
DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH,
/* private: */
__DPLL_LOCK_STATUS_ERROR_MAX,
DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
};
#define DPLL_TEMP_DIVIDER 1000 #define DPLL_TEMP_DIVIDER 1000
/** /**
...@@ -150,6 +179,7 @@ enum dpll_a { ...@@ -150,6 +179,7 @@ enum dpll_a {
DPLL_A_LOCK_STATUS, DPLL_A_LOCK_STATUS,
DPLL_A_TEMP, DPLL_A_TEMP,
DPLL_A_TYPE, DPLL_A_TYPE,
DPLL_A_LOCK_STATUS_ERROR,
__DPLL_A_MAX, __DPLL_A_MAX,
DPLL_A_MAX = (__DPLL_A_MAX - 1) DPLL_A_MAX = (__DPLL_A_MAX - 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment