diff options
Diffstat (limited to 'drivers/media/video/samsung/mali/linux/mali_kernel_sysfs.c')
-rw-r--r-- | drivers/media/video/samsung/mali/linux/mali_kernel_sysfs.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/media/video/samsung/mali/linux/mali_kernel_sysfs.c b/drivers/media/video/samsung/mali/linux/mali_kernel_sysfs.c index 64853d7..77ebc9d 100644 --- a/drivers/media/video/samsung/mali/linux/mali_kernel_sysfs.c +++ b/drivers/media/video/samsung/mali/linux/mali_kernel_sysfs.c @@ -17,9 +17,7 @@ #include <linux/kernel.h> #include <linux/fs.h> #include <linux/device.h> -#include <linux/version.h> #include <linux/module.h> -#include <linux/slab.h> #include "mali_kernel_license.h" #include "mali_kernel_common.h" #include "mali_kernel_linux.h" @@ -46,9 +44,11 @@ #include "mali_kernel_core.h" #include "mali_user_settings_db.h" #include "mali_device_pause_resume.h" +#include "mali_profiling_internal.h" #define POWER_BUFFER_SIZE 3 +struct device *mali_device; static struct dentry *mali_debugfs_dir = NULL; typedef enum @@ -70,6 +70,7 @@ static const char* const mali_power_events[_MALI_MAX_EVENTS] = { static u32 virtual_power_status_register=0; static char pwr_buf[POWER_BUFFER_SIZE]; + static int open_copy_private_data(struct inode *inode, struct file *filp) { filp->private_data = inode->i_private; @@ -682,7 +683,7 @@ static const struct file_operations l2_all_counter_src1_fops = { static ssize_t power_events_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { - + memset(pwr_buf,0,POWER_BUFFER_SIZE); virtual_power_status_register = 0; if (!strncmp(ubuf,mali_power_events[_MALI_DEVICE_SUSPEND],strlen(mali_power_events[_MALI_DEVICE_SUSPEND]))) @@ -791,7 +792,7 @@ static ssize_t profiling_record_read(struct file *filp, char __user *ubuf, size_ char buf[64]; int r; - r = sprintf(buf, "%u\n", _mali_osk_profiling_is_recording() ? 1 : 0); + r = sprintf(buf, "%u\n", _mali_internal_profiling_is_recording() ? 1 : 0); return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); } @@ -824,16 +825,16 @@ static ssize_t profiling_record_write(struct file *filp, const char __user *ubuf u32 limit = MALI_PROFILING_MAX_BUFFER_ENTRIES; /* This can be made configurable at a later stage if we need to */ /* check if we are already recording */ - if (MALI_TRUE == _mali_osk_profiling_is_recording()) + if (MALI_TRUE == _mali_internal_profiling_is_recording()) { MALI_DEBUG_PRINT(3, ("Recording of profiling events already in progress\n")); return -EFAULT; } /* check if we need to clear out an old recording first */ - if (MALI_TRUE == _mali_osk_profiling_have_recording()) + if (MALI_TRUE == _mali_internal_profiling_have_recording()) { - if (_MALI_OSK_ERR_OK != _mali_osk_profiling_clear()) + if (_MALI_OSK_ERR_OK != _mali_internal_profiling_clear()) { MALI_DEBUG_PRINT(3, ("Failed to clear existing recording of profiling events\n")); return -EFAULT; @@ -841,7 +842,7 @@ static ssize_t profiling_record_write(struct file *filp, const char __user *ubuf } /* start recording profiling data */ - if (_MALI_OSK_ERR_OK != _mali_osk_profiling_start(&limit)) + if (_MALI_OSK_ERR_OK != _mali_internal_profiling_start(&limit)) { MALI_DEBUG_PRINT(3, ("Failed to start recording of profiling events\n")); return -EFAULT; @@ -853,7 +854,7 @@ static ssize_t profiling_record_write(struct file *filp, const char __user *ubuf { /* stop recording profiling data */ u32 count = 0; - if (_MALI_OSK_ERR_OK != _mali_osk_profiling_stop(&count)) + if (_MALI_OSK_ERR_OK != _mali_internal_profiling_stop(&count)) { MALI_DEBUG_PRINT(2, ("Failed to stop recording of profiling events\n")); return -EFAULT; @@ -877,7 +878,7 @@ static void *profiling_events_start(struct seq_file *s, loff_t *pos) loff_t *spos; /* check if we have data avaiable */ - if (MALI_TRUE != _mali_osk_profiling_have_recording()) + if (MALI_TRUE != _mali_internal_profiling_have_recording()) { return NULL; } @@ -897,13 +898,13 @@ static void *profiling_events_next(struct seq_file *s, void *v, loff_t *pos) loff_t *spos = v; /* check if we have data avaiable */ - if (MALI_TRUE != _mali_osk_profiling_have_recording()) + if (MALI_TRUE != _mali_internal_profiling_have_recording()) { return NULL; } /* check if the next entry actually is avaiable */ - if (_mali_osk_profiling_get_count() <= (u32)(*spos + 1)) + if (_mali_internal_profiling_get_count() <= (u32)(*spos + 1)) { return NULL; } @@ -928,7 +929,7 @@ static int profiling_events_show(struct seq_file *seq_file, void *v) index = (u32)*spos; /* Retrieve all events */ - if (_MALI_OSK_ERR_OK == _mali_osk_profiling_get_event(index, ×tamp, &event_id, data)) + if (_MALI_OSK_ERR_OK == _mali_internal_profiling_get_event(index, ×tamp, &event_id, data)) { seq_printf(seq_file, "%llu %u %u %u %u %u %u\n", timestamp, event_id, data[0], data[1], data[2], data[3], data[4]); return 0; @@ -1042,7 +1043,6 @@ static int mali_sysfs_user_settings_register(void) int mali_sysfs_register(struct mali_dev *device, dev_t dev, const char *mali_dev_name) { int err = 0; - struct device * mdev; device->mali_class = class_create(THIS_MODULE, mali_dev_name); if (IS_ERR(device->mali_class)) @@ -1050,10 +1050,10 @@ int mali_sysfs_register(struct mali_dev *device, dev_t dev, const char *mali_dev err = PTR_ERR(device->mali_class); goto init_class_err; } - mdev = device_create(device->mali_class, NULL, dev, NULL, mali_dev_name); - if (IS_ERR(mdev)) + mali_device = device_create(device->mali_class, NULL, dev, NULL, mali_dev_name); + if (IS_ERR(mali_device)) { - err = PTR_ERR(mdev); + err = PTR_ERR(mali_device); goto init_mdev_err; } |