ARM: tegra: Add support to parse pwr_i2c in command line
Chaitanya Bandi [Tue, 30 Oct 2012 06:53:03 +0000 (11:53 +0530)]
Bootloader passes pwr_i2c=1000 if 1Mhz is supported with
PWR_I2C. Parsing this is kernel.

Bug 1158569

Change-Id: I5c6c87e905dceb9d67ef1f23eaf0b70768481061
Signed-off-by: Chaitanya Bandi <bandik@nvidia.com>
Reviewed-on: http://git-master/r/159768
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/common.c

index f6d7f00..d782965 100644 (file)
@@ -173,5 +173,5 @@ void tegra_enable_pinmux(void);
 enum image_type get_tegra_image_type(void);
 int tegra_get_cvb_alignment_uV(void);
 int tegra_soc_device_init(const char *machine);
-
+int get_pwr_i2c_clk_rate(void);
 #endif
index f973d01..127fa3c 100644 (file)
@@ -122,7 +122,7 @@ static struct board_info camera_board_info;
 static int pmu_core_edp = 1200;        /* default 1.2V EDP limit */
 static int board_panel_type;
 static enum power_supply_type pow_supply_type = POWER_SUPPLY_TYPE_MAINS;
-
+static int pwr_i2c_clk = 400;
 /*
  * Storage for debug-macro.S's state.
  *
@@ -882,6 +882,19 @@ enum audio_codec_type get_audio_codec_type(void)
 }
 __setup("audio_codec=", tegra_audio_codec_type);
 
+static int tegra_get_pwr_i2c_clk_rate(char *options)
+{
+       int clk = simple_strtol(options, NULL, 16);
+       if (clk != 0)
+               pwr_i2c_clk = clk;
+       return 0;
+}
+
+int get_pwr_i2c_clk_rate(void)
+{
+       return pwr_i2c_clk;
+}
+__setup("pwr_i2c=", tegra_get_pwr_i2c_clk_rate);
 
 void tegra_get_board_info(struct board_info *bi)
 {