msm: camera: common: Add sysfs support for bw override
To simulate bus overflow recovery in camera, cpas needs sysfs to take input from shell and vote the final value as given, instead of consolidated values from cpas clients. Add initial support for sysfs to add nodes for all drivers. Add sysfs based debug node to maintain and update all settings. Add cpas settings to override final bw voted to camnoc and mnoc ports. Usage: adb shell "echo <driver_name>#<setting_name>=<value> > /sys/devices/platform/soc/soc:qcom,cam-req-mgr/debug_node" Example:i adb shell "echo cpas#camnoc_bw=100 > /sys/devices/platform/soc/soc:qcom,cam-req-mgr/debug_node" Input format for updating settings is strict. CRs-Fixed: 2646825 Change-Id: I8d6063240f9685474bf4b2899e8dfb3f74cbdb75 Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#ifndef _CAM_DEBUG_UTIL_H_
|
||||
#define _CAM_DEBUG_UTIL_H_
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define CAM_CDM (1 << 0)
|
||||
#define CAM_CORE (1 << 1)
|
||||
#define CAM_CPAS (1 << 2)
|
||||
@@ -44,6 +46,32 @@
|
||||
|
||||
#define STR_BUFFER_MAX_LENGTH 1024
|
||||
|
||||
/**
|
||||
* struct cam_cpas_debug_settings - Sysfs debug settings for cpas driver
|
||||
*/
|
||||
struct cam_cpas_debug_settings {
|
||||
uint64_t mnoc_hf_0_ab_bw;
|
||||
uint64_t mnoc_hf_0_ib_bw;
|
||||
uint64_t mnoc_hf_1_ab_bw;
|
||||
uint64_t mnoc_hf_1_ib_bw;
|
||||
uint64_t mnoc_sf_0_ab_bw;
|
||||
uint64_t mnoc_sf_0_ib_bw;
|
||||
uint64_t mnoc_sf_1_ab_bw;
|
||||
uint64_t mnoc_sf_1_ib_bw;
|
||||
uint64_t mnoc_sf_icp_ab_bw;
|
||||
uint64_t mnoc_sf_icp_ib_bw;
|
||||
uint64_t camnoc_bw;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct camera_debug_settings - Sysfs debug settings for camera
|
||||
*
|
||||
* @cpas_settings: Debug settings for cpas driver.
|
||||
*/
|
||||
struct camera_debug_settings {
|
||||
struct cam_cpas_debug_settings cpas_settings;
|
||||
};
|
||||
|
||||
/*
|
||||
* cam_debug_log()
|
||||
*
|
||||
@@ -211,4 +239,17 @@ const char *cam_get_module_name(unsigned int module_id);
|
||||
__LINE__, ##args); \
|
||||
})
|
||||
|
||||
/**
|
||||
* @brief : API to get camera debug settings
|
||||
* @return const struct camera_debug_settings pointer.
|
||||
*/
|
||||
const struct camera_debug_settings *cam_debug_get_settings(void);
|
||||
|
||||
/**
|
||||
* @brief : API to parse and store input from sysfs debug node
|
||||
* @return Number of bytes read from buffer on success, or -EPERM on error.
|
||||
*/
|
||||
ssize_t cam_debug_sysfs_node_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count);
|
||||
|
||||
#endif /* _CAM_DEBUG_UTIL_H_ */
|
||||
|
Reference in New Issue
Block a user