mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 09:22:27 +00:00
The MIPI DisCo device properties that are read by the driver from platform firmware, or hard-coded in the driver, should only be provided as sysfs entries when a driver probes successfully. However the device status and device number is updated even when there is no driver present, and hence can be updated when a Slave device is detected on the bus without being described in platform firmware and without any driver registered/probed. As suggested by GregKH, the attribute group for Slave status and device number is is added by default upon device registration. Credits to Vinod Koul for the status_show() function, shared in a separate patch and used as is here. The status table was modified to remove an unnecessary enum and status_show() is handled in a different group attribute than what was suggested by Vinod. Tested-by: Srinivas Kandgatla <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Co-developed-by: Vinod Koul <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
19 lines
530 B
C
19 lines
530 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* Copyright(c) 2015-2020 Intel Corporation. */
|
|
|
|
#ifndef __SDW_SYSFS_LOCAL_H
|
|
#define __SDW_SYSFS_LOCAL_H
|
|
|
|
/*
|
|
* SDW sysfs APIs -
|
|
*/
|
|
|
|
/* basic attributes to report status of Slave (attachment, dev_num) */
|
|
extern const struct attribute_group *sdw_slave_status_attr_groups[];
|
|
|
|
/* additional device-managed properties reported after driver probe */
|
|
int sdw_slave_sysfs_init(struct sdw_slave *slave);
|
|
int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave);
|
|
|
|
#endif /* __SDW_SYSFS_LOCAL_H */
|