This series contains small miscellaneous improvements to the FPD-Link
drivers.
These were sent originally in v14 of the "i2c-atr and FPDLink" series
(link below), but were then left out for v15. So I have assigned v2 to
this series.
I have trimmed the to/cc list a bit, as these don't really deal with i2c
and dt anymore.
Signed-off-by: Tomi Valkeinen <[email protected]>
---
Changes in v2:
- New patch which renames ASYNC to NONSYNC
- Minor cosmetic change
- I didn't take u32_fract into use (as suggested by Andy), as I think it
makes the driver a bit more confusing.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Tomi Valkeinen (8):
media: i2c: ds90ub960: Configure CSI-2 continuous clock
media: i2c: ds90ub953: Use v4l2_fwnode_endpoint_parse()
media: i2c: ds90ub913: Use v4l2_fwnode_endpoint_parse()
media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK
media: i2c: ds90ub960: Allow FPD-Link async mode
media: i2c: ds90ub953: Restructure clkout management
media: i2c: ds90ub953: Support non-sync mode
media: i2c: ds90ub960: Rename RXPORT_MODE_CSI2_ASYNC to RXPORT_MODE_CSI2_NONSYNC
drivers/media/i2c/ds90ub913.c | 32 ++++---
drivers/media/i2c/ds90ub953.c | 193 +++++++++++++++++++++++++-----------------
drivers/media/i2c/ds90ub960.c | 31 ++++---
3 files changed, 152 insertions(+), 104 deletions(-)
---
base-commit: 28999781d15f94046e6c23a9a7d92ad28a436abf
change-id: 20230720-fpdlink-additions-fb5397336725
Best regards,
--
Tomi Valkeinen <[email protected]>
Use 'clock-noncontinuous' from DT to configure the
continuous/non-continuous clock setting for the TX ports.
Signed-off-by: Tomi Valkeinen <[email protected]>
---
drivers/media/i2c/ds90ub960.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c
index b9a1ef63629b..a83091f47140 100644
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@ -149,6 +149,7 @@
#define UB960_TR_CSI_CTL 0x33
#define UB960_TR_CSI_CTL_CSI_CAL_EN BIT(6)
+#define UB960_TR_CSI_CTL_CSI_CONTS_CLOCK BIT(1)
#define UB960_TR_CSI_CTL_CSI_ENABLE BIT(0)
#define UB960_TR_CSI_CTL2 0x34
@@ -485,6 +486,7 @@ struct ub960_txport {
u8 nport; /* TX port number, and index in priv->txport[] */
u32 num_data_lanes;
+ bool non_continous_clk;
};
struct ub960_data {
@@ -1133,6 +1135,9 @@ static int ub960_parse_dt_txport(struct ub960_data *priv,
goto err_free_txport;
}
+ txport->non_continous_clk = vep.bus.mipi_csi2.flags &
+ V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
+
txport->num_data_lanes = vep.bus.mipi_csi2.num_data_lanes;
if (vep.nr_of_link_frequencies != 1) {
@@ -1744,6 +1749,9 @@ static void ub960_init_tx_port(struct ub960_data *priv,
csi_ctl |= (4 - txport->num_data_lanes) << 4;
+ if (!txport->non_continous_clk)
+ csi_ctl |= UB960_TR_CSI_CTL_CSI_CONTS_CLOCK;
+
ub960_txport_write(priv, nport, UB960_TR_CSI_CTL, csi_ctl);
}
--
2.34.1
On Thu, Jul 20, 2023 at 01:30:31PM +0300, Tomi Valkeinen wrote:
> This series contains small miscellaneous improvements to the FPD-Link
> drivers.
>
> These were sent originally in v14 of the "i2c-atr and FPDLink" series
> (link below), but were then left out for v15. So I have assigned v2 to
> this series.
>
> I have trimmed the to/cc list a bit, as these don't really deal with i2c
> and dt anymore.
FWIW,
Reviewed-by: Andy Shevchenko <[email protected]>
for all, but patch 6. I still think u32_fract makes sense.
--
With Best Regards,
Andy Shevchenko
Hi Tomi,
Thank you for the patch.
On Thu, Jul 20, 2023 at 01:30:32PM +0300, Tomi Valkeinen wrote:
> Use 'clock-noncontinuous' from DT to configure the
> continuous/non-continuous clock setting for the TX ports.
>
> Signed-off-by: Tomi Valkeinen <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
> ---
> drivers/media/i2c/ds90ub960.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c
> index b9a1ef63629b..a83091f47140 100644
> --- a/drivers/media/i2c/ds90ub960.c
> +++ b/drivers/media/i2c/ds90ub960.c
> @@ -149,6 +149,7 @@
>
> #define UB960_TR_CSI_CTL 0x33
> #define UB960_TR_CSI_CTL_CSI_CAL_EN BIT(6)
> +#define UB960_TR_CSI_CTL_CSI_CONTS_CLOCK BIT(1)
> #define UB960_TR_CSI_CTL_CSI_ENABLE BIT(0)
>
> #define UB960_TR_CSI_CTL2 0x34
> @@ -485,6 +486,7 @@ struct ub960_txport {
> u8 nport; /* TX port number, and index in priv->txport[] */
>
> u32 num_data_lanes;
> + bool non_continous_clk;
> };
>
> struct ub960_data {
> @@ -1133,6 +1135,9 @@ static int ub960_parse_dt_txport(struct ub960_data *priv,
> goto err_free_txport;
> }
>
> + txport->non_continous_clk = vep.bus.mipi_csi2.flags &
> + V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
> +
> txport->num_data_lanes = vep.bus.mipi_csi2.num_data_lanes;
>
> if (vep.nr_of_link_frequencies != 1) {
> @@ -1744,6 +1749,9 @@ static void ub960_init_tx_port(struct ub960_data *priv,
>
> csi_ctl |= (4 - txport->num_data_lanes) << 4;
>
> + if (!txport->non_continous_clk)
> + csi_ctl |= UB960_TR_CSI_CTL_CSI_CONTS_CLOCK;
> +
> ub960_txport_write(priv, nport, UB960_TR_CSI_CTL, csi_ctl);
> }
>
--
Regards,
Laurent Pinchart