From b9fcc4bd40ef0d76cd824b50f47bacf890f8ffc7 Mon Sep 17 00:00:00 2001 From: chailu1 Date: Tue, 7 Dec 2021 14:19:03 +0800 Subject: [PATCH] PD:Revert "(CR):rt1715:add debugfs interface for dump reg" richtek default support reg dump feature at /d/rt-regmap so revert this changes and keep richtek default configure. This reverts commit 7bbb1dcedc862205420cbabe00d2f4134de27f6e. Change-Id: Id1cca8463c4411aa337d36b2938bf2eb32da4f72 Reviewed-on: https://gerrit.mot.com/2137059 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/usb/typec/mmi_tcpc/tcpc_rt1711h.c | 56 ----------------------- 1 file changed, 56 deletions(-) diff --git a/drivers/usb/typec/mmi_tcpc/tcpc_rt1711h.c b/drivers/usb/typec/mmi_tcpc/tcpc_rt1711h.c index f87ae4bae88d..a93607817099 100644 --- a/drivers/usb/typec/mmi_tcpc/tcpc_rt1711h.c +++ b/drivers/usb/typec/mmi_tcpc/tcpc_rt1711h.c @@ -45,8 +45,6 @@ /* #define DEBUG_GPIO 66 */ -#include - #define RT1711H_DRV_VERSION "2.0.5_G" #define RT1711H_IRQ_WAKE_TIME (500) /* ms */ @@ -72,7 +70,6 @@ struct rt1711_chip { int irq_gpio; int irq; int chip_id; - struct dentry *debug_root; }; #ifdef CONFIG_RT_REGMAP @@ -1587,59 +1584,7 @@ static inline int rt1711h_check_revision(struct i2c_client *client) return did; } -#if defined(CONFIG_DEBUG_FS) -static int show_registers(struct seq_file *m, void *data) -{ - struct rt1711_chip *chip = m->private; - u8 addr; - int ret; - u8 val; - for (addr = 0x0; addr <= 0xf6; addr++) { - ret = rt1711_read_device(chip->client, addr, 1, &val); - if (ret < 0) { - pr_err("read rt1715 reg%x fail(%d)\n",addr, ret); - } else - seq_printf(m, "Reg[%02X] = 0x%02X\n", addr, val); - - } - return 0; -} - -static int reg_debugfs_open(struct inode *inode, struct file *file) -{ - struct rt1711_chip *chip = inode->i_private; - - return single_open(file, show_registers, chip); -} - - -static const struct file_operations reg_debugfs_ops = { - .owner = THIS_MODULE, - .open = reg_debugfs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static void create_debugfs_entry(struct rt1711_chip *chip) -{ - chip->debug_root = debugfs_create_dir("rt1715-reg", NULL); - - if (!chip->debug_root) - pr_err("Failed to create debug dir\n"); - - if (chip->debug_root) { - debugfs_create_file("registers", - S_IFREG | S_IRUGO, - chip->debug_root, chip, ®_debugfs_ops); - - } -} -#else -static void create_debugfs_entry(struct rt1711_chip *chip) -{} -#endif static int rt1711_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -1707,7 +1652,6 @@ static int rt1711_i2c_probe(struct i2c_client *client, } tcpc_schedule_init_work(chip->tcpc); - create_debugfs_entry(chip); pr_info("%s probe OK!\n", __func__); return 0;