From 7086ef70a958b19ebd70705366be490dabda804a Mon Sep 17 00:00:00 2001 From: Chris Dragan Date: Wed, 25 Apr 2018 05:32:20 -0700 Subject: [PATCH] misc: mods: remove smartdimmer support Change-Id: I57d34222ca496e4fbdc70c9001e5efa529ee03ab Signed-off-by: Chris Dragan Reviewed-on: https://git-master.nvidia.com/r/1702334 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Lael Jones GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/misc/mods/mods_debugfs.c | 128 +------------------ drivers/misc/mods/mods_internal.h | 12 +- drivers/misc/mods/mods_krnl.c | 13 +- drivers/misc/mods/mods_tegradc.c | 203 +----------------------------- 4 files changed, 6 insertions(+), 350 deletions(-) diff --git a/drivers/misc/mods/mods_debugfs.c b/drivers/misc/mods/mods_debugfs.c index f4d59cbf..fd32dc4a 100644 --- a/drivers/misc/mods/mods_debugfs.c +++ b/drivers/misc/mods/mods_debugfs.c @@ -1,7 +1,7 @@ /* * mods_debugfs.c - This file is part of NVIDIA MODS kernel driver. * - * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. * * NVIDIA MODS kernel driver is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License, @@ -294,6 +294,7 @@ static int mods_dc_border_get(void *data, u64 *val) { struct tegra_dc *dc = data; u32 blender_reg = DC_DISP_BLEND_BACKGROUND_COLOR; + if (!dc->enabled) *val = 0ULL; else @@ -304,6 +305,7 @@ static int mods_dc_border_set(void *data, u64 val) { struct tegra_dc *dc = data; u32 blender_reg = DC_DISP_BLEND_BACKGROUND_COLOR; + if (!dc->enabled) return 0; mutex_lock(&dc->lock); @@ -317,97 +319,6 @@ static int mods_dc_border_set(void *data, u64 val) DEFINE_SIMPLE_ATTRIBUTE(mods_dc_border_fops, mods_dc_border_get, mods_dc_border_set, "0x%llx\n"); -static int mods_sd_brightness_get(void *data, u64 *val) -{ - struct tegra_dc *dc = data; - - if (!dc->enabled) - *val = 0ULL; - else { - *val = (u64)tegra_dc_readl_exported(dc, DC_DISP_SD_BL_CONTROL); - *val = SD_BLC_BRIGHTNESS(*val); - } - return 0; -} -DEFINE_SIMPLE_ATTRIBUTE(mods_sd_brightness_fops, mods_sd_brightness_get, - NULL, "%llu\n"); - -static int mods_sd_pixel_count_get(void *data, u64 *val) -{ - struct tegra_dc *dc = data; - - if (!dc->enabled) - *val = 0ULL; - else - *val = (u64)tegra_dc_readl_exported(dc, DC_DISP_SD_PIXEL_COUNT); - return 0; -} -DEFINE_SIMPLE_ATTRIBUTE(mods_sd_pixel_count_fops, mods_sd_pixel_count_get, - NULL, "%llu\n"); - -static int mods_sd_hw_k_rgb_show(struct seq_file *s, void *unused) -{ - struct tegra_dc *dc = s->private; - u32 val; - - if (!dc->enabled) - val = 0U; - else - val = tegra_dc_readl_exported(dc, DC_DISP_SD_HW_K_VALUES); - - seq_printf(s, "%u %u %u\n", SD_HW_K_R(val), SD_HW_K_G(val), - SD_HW_K_B(val)); - return 0; -} - -static int mods_sd_hw_k_rgb_open(struct inode *inode, struct file *file) -{ - return single_open(file, mods_sd_hw_k_rgb_show, inode->i_private); -} - -static const struct file_operations mods_sd_hw_k_rgb_fops = { - .open = mods_sd_hw_k_rgb_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int mods_sd_histogram_show(struct seq_file *s, void *unused) -{ - struct tegra_dc *dc = s->private; - u32 i; - - for (i = 0; i < DC_DISP_SD_HISTOGRAM_NUM; i++) { - u32 val; - - if (!dc->enabled) - val = 0U; - else - val = tegra_dc_readl_exported(dc, - DC_DISP_SD_HISTOGRAM(i)); - seq_printf(s, "%u %u %u %u\n", - SD_HISTOGRAM_BIN_0(val), - SD_HISTOGRAM_BIN_1(val), - SD_HISTOGRAM_BIN_2(val), - SD_HISTOGRAM_BIN_3(val)); - } - - return 0; -} - -static int mods_sd_histogram_open(struct inode *inode, struct file *file) -{ - return single_open(file, mods_sd_histogram_show, inode->i_private); -} - -static const struct file_operations mods_sd_histogram_fops = { - .open = mods_sd_histogram_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - - static int mods_dc_ocp_show(struct seq_file *s, void *unused) { seq_puts(s, "rgb\n"); @@ -626,9 +537,6 @@ int mods_create_debugfs(struct miscdevice *modsdev) #ifdef CONFIG_TEGRA_DC for (dc_idx = 0; dc_idx < nheads; dc_idx++) { struct dentry *dc_debugfs_dir; -#ifdef CONFIG_TEGRA_NVSD - struct dentry *sd_debugfs_dir; -#endif char devname[16]; struct tegra_dc *dc = tegra_dc_get_dc(dc_idx); @@ -712,36 +620,6 @@ int mods_create_debugfs(struct miscdevice *modsdev) goto remove_out; } -#if defined(CONFIG_TEGRA_NVSD) - sd_debugfs_dir = debugfs_create_dir("smartdimmer", - dc_debugfs_dir); - - retval = debugfs_create_file("brightness", 0444, - sd_debugfs_dir, dc, &mods_sd_brightness_fops); - if (IS_ERR(retval)) { - err = -EIO; - goto remove_out; - } - retval = debugfs_create_file("pixel_count", 0444, - sd_debugfs_dir, dc, &mods_sd_pixel_count_fops); - if (IS_ERR(retval)) { - err = -EIO; - goto remove_out; - } - retval = debugfs_create_file("hw_k_rgb", 0444, - sd_debugfs_dir, dc, &mods_sd_hw_k_rgb_fops); - if (IS_ERR(retval)) { - err = -EIO; - goto remove_out; - } - retval = debugfs_create_file("histogram", 0444, - sd_debugfs_dir, dc, &mods_sd_histogram_fops); - if (IS_ERR(retval)) { - err = -EIO; - goto remove_out; - } -#endif - if (dc->out && dc->out->type == TEGRA_DC_OUT_DSI) { struct dentry *dsi_debugfs_dir; diff --git a/drivers/misc/mods/mods_internal.h b/drivers/misc/mods/mods_internal.h index c0657657..b6e08c76 100644 --- a/drivers/misc/mods/mods_internal.h +++ b/drivers/misc/mods/mods_internal.h @@ -81,7 +81,7 @@ struct mods_file_private_data { u32 access_token; }; -typedef struct mods_file_private_data *MODS_PRIV; +#define MODS_PRIV struct mods_file_private_data * /* VM private data */ struct mods_vm_private_data { @@ -549,8 +549,6 @@ int esc_mods_dma_async_issue_pending(struct file *fp, #ifdef CONFIG_TEGRA_DC int esc_mods_tegra_dc_config_possible(struct file *fp, struct MODS_TEGRA_DC_CONFIG_POSSIBLE *p); -int esc_mods_tegra_dc_setup_sd(struct file *fp, - struct MODS_TEGRA_DC_SETUP_SD *p); #endif #ifdef MODS_HAS_NET @@ -601,14 +599,6 @@ static inline int mods_create_debugfs(struct miscdevice *modsdev) static inline void mods_remove_debugfs(void) {} #endif /* CONFIG_DEBUG_FS */ -#ifdef CONFIG_TEGRA_DC -int mods_init_tegradc(void); -void mods_exit_tegradc(void); -#else -static inline int mods_init_tegradc(void) { return 0; } -static inline void mods_exit_tegradc(void) {} -#endif - #if defined(MODS_TEGRA) && defined(MODS_HAS_DMABUF) int mods_init_dmabuf(void); void mods_exit_dmabuf(void); diff --git a/drivers/misc/mods/mods_krnl.c b/drivers/misc/mods/mods_krnl.c index c16dd006..7b18e279 100644 --- a/drivers/misc/mods/mods_krnl.c +++ b/drivers/misc/mods/mods_krnl.c @@ -216,10 +216,6 @@ static int __init mods_init_module(void) if (rc < 0) return rc; - rc = mods_init_tegradc(); - if (rc < 0) - return rc; - rc = mods_init_dmabuf(); if (rc < 0) return rc; @@ -243,8 +239,6 @@ static void __exit mods_exit_module(void) mods_exit_dmabuf(); - mods_exit_tegradc(); - mods_remove_debugfs(); mods_cleanup_irq(); @@ -554,7 +548,7 @@ static void mods_krnl_vma_close(struct vm_area_struct *vma) LOG_EXT(); } -static struct vm_operations_struct mods_krnl_vm_ops = { +static const struct vm_operations_struct mods_krnl_vm_ops = { .open = mods_krnl_vma_open, .close = mods_krnl_vma_close }; @@ -1774,11 +1768,6 @@ static long mods_krnl_ioctl(struct file *fp, esc_mods_tegra_dc_config_possible, MODS_TEGRA_DC_CONFIG_POSSIBLE); break; - case MODS_ESC_TEGRA_DC_SETUP_SD: - MODS_IOCTL_NORETVAL(MODS_ESC_TEGRA_DC_SETUP_SD, - esc_mods_tegra_dc_setup_sd, - MODS_TEGRA_DC_SETUP_SD); - break; #endif #ifdef MODS_HAS_NET case MODS_ESC_NET_FORCE_LINK: diff --git a/drivers/misc/mods/mods_tegradc.c b/drivers/misc/mods/mods_tegradc.c index 0e00e01c..668e3976 100644 --- a/drivers/misc/mods/mods_tegradc.c +++ b/drivers/misc/mods/mods_tegradc.c @@ -19,9 +19,6 @@ #include #include <../drivers/video/tegra/dc/dc_priv.h> -#if defined(CONFIG_TEGRA_NVSD) -#include <../drivers/video/tegra/dc/nvsd.h> -#endif #include