Re: [PATCH v3 14/14] ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver

From: Daniel Scally
Date: Sat Dec 26 2020 - 18:24:32 EST


Hi Andy

On 24/12/2020 12:54, Andy Shevchenko wrote:
> On Thu, Dec 24, 2020 at 3:12 AM Daniel Scally <djrscally@xxxxxxxxx> wrote:
>>
>> Currently on platforms designed for Windows, connections between CIO2 and
>> sensors are not properly defined in DSDT. This patch extends the ipu3-cio2
>> driver to compensate by building software_node connections, parsing the
>> connection properties from the sensor's SSDB buffer.
>
> Few nitpicks below, after addressing them
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

Thanks, and for all the time you've put into this series

>> +/*
>> + * Extend this array with ACPI Hardware ID's of devices known to be working
>
> ID's -> IDs ?

Yes, turns out I'm pretty bad at apostrophes.

>> +static void cio2_bridge_create_fwnode_properties(struct cio2_sensor *sensor,
>> + const struct cio2_sensor_config *cfg)
>> +{
>> + unsigned int i;
>> +
>> + sensor->prop_names = prop_names;
>> +
>> + for (i = 0; i < 4; i++)
>
> 4 here and below, can we have a local define for them, like
>
> #define CIO2_MAX_LANES 4

Done and for the other place it's mentioned below.

>> +static int cio2_bridge_connect_sensors(struct cio2_bridge *bridge,
>> + struct pci_dev *cio2)
>> +{
>> + struct fwnode_handle *fwnode;
>> + struct cio2_sensor *sensor;
>> + struct acpi_device *adev;
>> + unsigned int i;
>> + int ret = 0;
>
> You may drop this assignment and...
>
...
>
>> + return ret;
>
> ...use here
>
> return 0;
>
> directly.

Done

>> +enum cio2_sensor_swnodes {
>> + SWNODE_SENSOR_HID,
>> + SWNODE_SENSOR_PORT,
>> + SWNODE_SENSOR_ENDPOINT,
>> + SWNODE_CIO2_PORT,
>> + SWNODE_CIO2_ENDPOINT,
>
>> + SWNODE_COUNT,
>
> No comma?

Done

>> @@ -1715,6 +1732,23 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
>> return -ENOMEM;
>> cio2->pci_dev = pci_dev;
>>
>> + /*
>> + * On some platforms no connections to sensors are defined in firmware,
>> + * if the device has no endpoints then we can try to build those as
>> + * software_nodes parsed from SSDB.
>> + */
>> + if (!cio2_check_fwnode_graph(fwnode)) {
>> + if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) {
>
>> + dev_err(&pci_dev->dev,
>> + "fwnode graph has no endpoints connected\n");
>
> One line?

Done