|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
2 | 2 | /* |
3 | 3 | * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. |
4 | | - * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved. |
| 4 | + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
5 | 5 | */ |
6 | 6 |
|
7 | 7 | #ifndef _CAM_CCI_DEV_H_ |
@@ -181,6 +181,15 @@ enum cam_cci_state_t { |
181 | 181 | CCI_STATE_DISABLED, |
182 | 182 | }; |
183 | 183 |
|
| 184 | +#ifdef CONFIG_SPECTRA_SENSOR_SYSFS_UTIL |
| 185 | +struct cci_sysfs { |
| 186 | + int32_t master; |
| 187 | + int32_t cci_dev; |
| 188 | + struct kobject sysfs_kobj; |
| 189 | + struct mutex cci_mutex; |
| 190 | +}; |
| 191 | +#endif /*CONFIG_SPECTRA_SENSOR_SYSFS_UTIL*/ |
| 192 | + |
184 | 193 | /** |
185 | 194 | * struct cci_device |
186 | 195 | * @pdev: Platform device |
@@ -253,6 +262,10 @@ struct cci_device { |
253 | 262 | struct mutex init_mutex; |
254 | 263 | uint64_t dump_en; |
255 | 264 | bool is_probing; |
| 265 | +#ifdef CONFIG_SPECTRA_SENSOR_SYSFS_UTIL |
| 266 | + struct cci_sysfs cci_master_sysfs[MASTER_MAX]; |
| 267 | + int32_t num_masters; |
| 268 | +#endif /*CONFIG_SPECTRA_SENSOR_SYSFS_UTIL*/ |
256 | 269 | }; |
257 | 270 |
|
258 | 271 | enum cam_cci_i2c_cmd_type { |
@@ -332,6 +345,17 @@ struct v4l2_subdev *cam_cci_get_subdev(int cci_dev_index); |
332 | 345 | void cam_cci_dump_registers(struct cci_device *cci_dev, |
333 | 346 | enum cci_i2c_master_t master, enum cci_i2c_queue_t queue); |
334 | 347 |
|
| 348 | +#ifdef CONFIG_SPECTRA_SENSOR_SYSFS_UTIL |
| 349 | +/** |
| 350 | + * @brief : API to update client bus information. |
| 351 | + * @bus_id : cci bus id, this is basically cci cel index |
| 352 | + * @cci_dev : cci device handle |
| 353 | + * @master_id : master id of the client |
| 354 | + */ |
| 355 | +int32_t cam_cci_get_bus_info(int32_t bus_id, int32_t cci_idx, |
| 356 | + int32_t *cci_dev, int32_t *master_id); |
| 357 | +#endif /*CONFIG_SPECTRA_SENSOR_SYSFS_UTIL*/ |
| 358 | + |
335 | 359 | /** |
336 | 360 | * @brief : API to register CCI hw to platform framework. |
337 | 361 | * @return struct platform_device pointer on on success, or ERR_PTR() on error. |
|
0 commit comments