Skip to content

Commit

Permalink
media: i2c: ds90ub960: Add support for DS90UB954-Q1
Browse files Browse the repository at this point in the history
DS90UB954-Q1 is an FPDLink-III deserializer that is mostly register
compatible with DS90UB960-Q1. The main difference is that it supports
half of the RX and TX ports, i.e. 2x FPDLink RX ports and 1x CSI TX
port.

Some other registers are marked as reserved in the datasheet as well,
notably around CSI-TX frame and line-count monitoring and some other
status registers. The datasheet also does not mention anything about
setting strobe position, and fails to lock the RX ports if we forcefully
set it, so disable it through the hw_data.

Link: https://www.ti.com/lit/gpn/ds90ub954-q1
Signed-off-by: Jai Luthra <[email protected]>
Signed-off-by: Vignesh Raghavendra <[email protected]>
  • Loading branch information
jailuthra authored and 6by9 committed Nov 22, 2024
1 parent 953e77f commit 902c3b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ allOf:
properties:
compatible:
enum:
- ti,ds90ub954-q1
- ti,ds90ub960-q1
- ti,ds90ub9702-q1

Expand Down
12 changes: 11 additions & 1 deletion drivers/media/i2c/ds90ub960.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ struct ub960_hw_data {
u8 num_txports;
bool is_ub9702;
bool is_fpdlink4;
bool ignore_strobe_pos;
};

enum ub960_rxport_mode {
Expand Down Expand Up @@ -1423,7 +1424,7 @@ static void ub960_rxport_config_eq(struct ub960_data *priv, unsigned int nport)

if (priv->strobe.manual)
ub960_rxport_set_strobe_pos(priv, nport, rxport->eq.strobe_pos);
else
else if (!priv->hw_data->ignore_strobe_pos)
ub960_rxport_set_strobe_pos(priv, nport, 0);

if (rxport->eq.manual_eq) {
Expand Down Expand Up @@ -4016,6 +4017,13 @@ static void ub960_remove(struct i2c_client *client)
mutex_destroy(&priv->reg_lock);
}

static const struct ub960_hw_data ds90ub954_hw = {
.model = "ub954",
.num_rxports = 2,
.num_txports = 1,
.ignore_strobe_pos = true,
};

static const struct ub960_hw_data ds90ub960_hw = {
.model = "ub960",
.num_rxports = 4,
Expand All @@ -4031,13 +4039,15 @@ static const struct ub960_hw_data ds90ub9702_hw = {
};

static const struct i2c_device_id ub960_id[] = {
{ "ds90ub954-q1", (kernel_ulong_t)&ds90ub954_hw },
{ "ds90ub960-q1", (kernel_ulong_t)&ds90ub960_hw },
{ "ds90ub9702-q1", (kernel_ulong_t)&ds90ub9702_hw },
{}
};
MODULE_DEVICE_TABLE(i2c, ub960_id);

static const struct of_device_id ub960_dt_ids[] = {
{ .compatible = "ti,ds90ub954-q1", .data = &ds90ub954_hw },
{ .compatible = "ti,ds90ub960-q1", .data = &ds90ub960_hw },
{ .compatible = "ti,ds90ub9702-q1", .data = &ds90ub9702_hw },
{}
Expand Down

0 comments on commit 902c3b2

Please sign in to comment.