Re: [PATCH] ipu3-cio2: Parse sensor orientation and rotation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Fabian - sorry for the late reply.

On 22/03/2021 15:16, Fabian Wüthrich wrote:
>>> +#define CIO2_SENSOR_ROTATION_NORMAL		0
>>> +#define CIO2_SENSOR_ROTATION_INVERTED		1
>>> +
>>
>> I think these are good here but...
>>
>>> +/* Panel position defined in _PLD section of ACPI Specification 6.3 */
>>> +#define CIO2_PLD_PANEL_TOP			0
>>> +#define CIO2_PLD_PANEL_BOTTOM			1
>>> +#define CIO2_PLD_PANEL_LEFT			2
>>> +#define CIO2_PLD_PANEL_RIGHT			3
>>> +#define CIO2_PLD_PANEL_FRONT			4
>>> +#define CIO2_PLD_PANEL_BACK			5
>>> +#define CIO2_PLD_PANEL_UNKNOWN			6
>>> +
>>
>> ...I wonder if these ought to go somewhere in the include/acpi headers.
>> You might be the only person to refer to pld->panel in driver code (at
>> least a quick grep doesn't show me another one, and only another couple
>> of uses of pld at all) so it's probably not a big deal, but it just
>> feels slightly the wrong place. What do you think?
>>
> I agree. What about include/acpi/acbuffer.h? But I don't know if this
> hinders the acceptance of this patch.


Yeah I think that's probably the right place. I don't think this is a
blocker no, but you'll need to do a v2 anyway to extend the array below,
so you could include another patch then.

>
>>>  #define CIO2_SENSOR_CONFIG(_HID, _NR, ...)	\
>>>  	(const struct cio2_sensor_config) {	\
>>>  		.hid = _HID,			\
>>> @@ -80,6 +93,7 @@ struct cio2_sensor_ssdb {
>>>  struct cio2_property_names {
>>>  	char clock_frequency[16];
>>>  	char rotation[9];
>>> +	char orientation[12];
>>>  	char bus_type[9];
>>>  	char data_lanes[11];
>>>  	char remote_endpoint[16];
>>> @@ -106,6 +120,8 @@ struct cio2_sensor {
>>>  	struct cio2_node_names node_names;
>>>  
>>>  	struct cio2_sensor_ssdb ssdb;
>>> +	struct acpi_pld_info *pld;
>>> +
>>>  	struct cio2_property_names prop_names;
>>>  	struct property_entry ep_properties[5];
>>>  	struct property_entry dev_properties[3];
>>
>> You should extend dev_properties to 4 members; there needs to be an
>> empty entry as a terminator or it'll be a problem in the event someone
>> tries to access a property that isn't there.
>>
> Good catch. Thanks I missed that.



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux