#define CSI2_PADS_NUM 2
#define CSI2_MAX_LANES 4
+#define CSI2_MAX_LINK_FREQS 3
#define CSI2_MAX_ACPI_GPIOS 2u
};
struct atomisp_csi2_property_names {
+ char clock_frequency[16];
char rotation[9];
char bus_type[9];
char data_lanes[11];
char remote_endpoint[16];
+ char link_frequencies[17];
};
struct atomisp_csi2_node_names {
struct atomisp_csi2_sensor_config {
const char *hid;
int lanes;
+ int nr_link_freqs;
+ u64 link_freqs[CSI2_MAX_LINK_FREQS];
};
struct atomisp_csi2_sensor {
struct software_node swnodes[SWNODE_COUNT];
struct atomisp_csi2_node_names node_names;
struct atomisp_csi2_property_names prop_names;
- /* "rotation" + terminating entry */
- struct property_entry dev_properties[2];
- /* "bus-type", "data-lanes", "remote-endpoint" + terminating entry */
- struct property_entry ep_properties[4];
+ /* "clock-frequency", "rotation" + terminating entry */
+ struct property_entry dev_properties[3];
+ /* "bus-type", "data-lanes", "remote-endpoint" + "link-freq" + terminating entry */
+ struct property_entry ep_properties[5];
/* "data-lanes", "remote-endpoint" + terminating entry */
struct property_entry csi2_properties[3];
struct software_node_ref_args local_ref[1];
/*
* Extend this array with ACPI Hardware IDs of sensors known to be working
- * plus the number of links expected by their drivers.
+ * plus the default number of links + link-frequencies.
*
* Do not add an entry for a sensor that is not actually supported,
* or which have not yet been converted to work without atomisp_gmin
}
static const struct atomisp_csi2_property_names prop_names = {
+ .clock_frequency = "clock-frequency",
.rotation = "rotation",
.bus_type = "bus-type",
.data_lanes = "data-lanes",
.remote_endpoint = "remote-endpoint",
+ .link_frequencies = "link-frequencies",
};
static void atomisp_csi2_create_fwnode_properties(struct atomisp_csi2_sensor *sensor,
sensor->local_ref[0] = SOFTWARE_NODE_REFERENCE(&sensor->swnodes[SWNODE_CSI2_ENDPOINT]);
sensor->remote_ref[0] = SOFTWARE_NODE_REFERENCE(&sensor->swnodes[SWNODE_SENSOR_ENDPOINT]);
- sensor->dev_properties[0] = PROPERTY_ENTRY_U32(sensor->prop_names.rotation, 0);
+ sensor->dev_properties[0] = PROPERTY_ENTRY_U32(sensor->prop_names.clock_frequency,
+ PMC_CLK_RATE_19_2MHZ);
+ sensor->dev_properties[1] = PROPERTY_ENTRY_U32(sensor->prop_names.rotation, 0);
sensor->ep_properties[0] = PROPERTY_ENTRY_U32(sensor->prop_names.bus_type,
V4L2_FWNODE_BUS_TYPE_CSI2_DPHY);
sensor->lanes);
sensor->ep_properties[2] = PROPERTY_ENTRY_REF_ARRAY(sensor->prop_names.remote_endpoint,
sensor->local_ref);
+ if (cfg->nr_link_freqs > 0)
+ sensor->ep_properties[3] =
+ PROPERTY_ENTRY_U64_ARRAY_LEN(sensor->prop_names.link_frequencies,
+ cfg->link_freqs, cfg->nr_link_freqs);
sensor->csi2_properties[0] = PROPERTY_ENTRY_U32_ARRAY_LEN(sensor->prop_names.data_lanes,
bridge->data_lanes,