ARM: tegra: change permission of pinmux debugfs
Andy Park [Mon, 6 May 2013 23:11:19 +0000 (16:11 -0700)]
Change the permission of tegra_pinmux debug node to be able to write
to it so that the functionality of changing pinmux configuration is
useful. Also added some instruction for the usages.

Bug 1213934

Change-Id: Iada4f345d95e12ab21e175aae768c146082774b7
Signed-off-by: Andy Park <andyp@nvidia.com>
(cherry picked from commit 1491f7a3bfe4748b3cb96e3f85b2844786f8e917)
Reviewed-on: http://git-master/r/226391
Reviewed-by: Simon Je <sje@nvidia.com>
Tested-by: Simon Je <sje@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkata (Muni) Anda <vanda@nvidia.com>

arch/arm/mach-tegra/pinmux.c

index 2fd2ff2..54bad55 100644 (file)
@@ -1203,6 +1203,13 @@ static int dbg_pinmux_open(struct inode *inode, struct file *file)
        return single_open(file, dbg_pinmux_show, &inode->i_private);
 }
 
+/*
+ * Changing pinmux configuration at runtime
+ *
+ * Usage: Feed "<PINGROUP> <FUNCTION> <E_INPUT> <PUPD> <TRISTATE>"
+ *        to tegra_pinmux
+ * ex) # echo "HDMI_CEC CEC OUTPUT NORMAL TRISTATE" > /d/tegra_pinmux
+ */
 #define DELIMITER " \n"
 static ssize_t dbg_pinmux_write(struct file *file,
        const char __user *userbuf, size_t count, loff_t *ppos)
@@ -1368,7 +1375,7 @@ static const struct file_operations debug_drive_fops = {
 
 static int __init tegra_pinmux_debuginit(void)
 {
-       (void) debugfs_create_file("tegra_pinmux", S_IRUGO,
+       (void) debugfs_create_file("tegra_pinmux", S_IRUGO | S_IWUGO,
                                        NULL, NULL, &debug_fops);
        (void) debugfs_create_file("tegra_pinmux_drive", S_IRUGO,
                                        NULL, NULL, &debug_drive_fops);