[PATCH 5/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00109244-1 MX51 Add GPO* regulators.

Bryan Wu bryan.wu at canonical.com
Fri Jul 10 01:47:02 UTC 2009


Brad Figg wrote:
> From: Ann Thornton <Ann.Thornton at freescale.com>
> 
> Added the constraint structures and registered GPO regulators.
> 
> Signed-off-by: Ann Thornton <Ann.Thornton at freescale.com>
> Signed-off-by: Brad Figg <brad.figg at canonical.com>
> ---
>  arch/arm/mach-mx51/mx51_3stack_pmic_mc13892.c  |   33 ++++++++++++++++++++++-
>  arch/arm/mach-mx51/mx51_babbage_pmic_mc13892.c |   29 +++++++++++++++++++++
>  2 files changed, 60 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-mx51/mx51_3stack_pmic_mc13892.c b/arch/arm/mach-mx51/mx51_3stack_pmic_mc13892.c
> index b2cfdba..b5434f2 100644
> --- a/arch/arm/mach-mx51/mx51_3stack_pmic_mc13892.c
> +++ b/arch/arm/mach-mx51/mx51_3stack_pmic_mc13892.c
> @@ -207,6 +207,7 @@ static struct regulator_init_data vgen2_init = {
>  		.min_uV = mV_to_uV(1200),
>  		.max_uV = mV_to_uV(3150),
>  		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
> +		.boot_on = 1,
>  	}
>  };
>  
> @@ -219,6 +220,30 @@ static struct regulator_init_data vgen3_init = {
>  	}
>  };
>  
> +static struct regulator_init_data gpo1_init = {
> +	.constraints = {
> +		.name = "GPO1",
> +	}
> +};
> +
> +static struct regulator_init_data gpo2_init = {
> +	.constraints = {
> +		.name = "GPO2",
> +	}
> +};
> +
> +static struct regulator_init_data gpo3_init = {
> +	.constraints = {
> +		.name = "GPO3",
> +	}
> +};
> +
> +static struct regulator_init_data gpo4_init = {
> +	.constraints = {
> +		.name = "GPO4",
> +	}
> +};
> +
>  /*!
>   * the event handler for power on event
>   */
> @@ -233,6 +258,7 @@ static int mc13892_regulator_init(struct mc13892 *mc13892)
>  	pmic_event_callback_t power_key_event;
>  	int register_mask;
>  
> +	printk("Initializing regulators for 3-stack.\n");

pr_debug("..."); is better here, IMHO.

>  	if (mxc_cpu_is_rev(CHIP_REV_2_0) < 0)
>  		sw2_init.constraints.state_mem.uV = 1100000;
>  
> @@ -253,7 +279,6 @@ static int mc13892_regulator_init(struct mc13892 *mc13892)
>  	register_mask = BITFMASK(STANDBYSECINV);
>  	pmic_write_reg(REG_POWER_CTL2, value, register_mask);
>  
> -
>  	mc13892_register_regulator(mc13892, MC13892_SW1, &sw1_init);
>  	mc13892_register_regulator(mc13892, MC13892_SW2, &sw2_init);
>  	mc13892_register_regulator(mc13892, MC13892_SW3, &sw3_init);
> @@ -271,6 +296,10 @@ static int mc13892_regulator_init(struct mc13892 *mc13892)
>  	mc13892_register_regulator(mc13892, MC13892_VGEN2, &vgen2_init);
>  	mc13892_register_regulator(mc13892, MC13892_VGEN3, &vgen3_init);
>  	mc13892_register_regulator(mc13892, MC13892_VUSB, &vusb_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO1, &gpo1_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO2, &gpo2_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO3, &gpo3_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO4, &gpo4_init);
>  
>  	return 0;
>  }
> @@ -281,7 +310,7 @@ static struct mc13892_platform_data mc13892_plat = {
>  
>  static struct i2c_board_info __initdata mc13892_i2c_device = {
>  	I2C_BOARD_INFO("mc13892", 0x08),
> -	.irq  = IOMUX_TO_IRQ(MX51_PIN_GPIO1_5),
> +	.irq = MX51_PIN_GPIO1_5,

Actually, I failed to see why did they change this. Nothing important from the
git log. Is the IOMUX_TO_IRQ() macro disappeared in other patch?

>  	.platform_data = &mc13892_plat,
>  };
>  
> diff --git a/arch/arm/mach-mx51/mx51_babbage_pmic_mc13892.c b/arch/arm/mach-mx51/mx51_babbage_pmic_mc13892.c
> index b0bdfd7..edbc458 100644
> --- a/arch/arm/mach-mx51/mx51_babbage_pmic_mc13892.c
> +++ b/arch/arm/mach-mx51/mx51_babbage_pmic_mc13892.c
> @@ -218,8 +218,33 @@ static struct regulator_init_data vgen3_init = {
>  	}
>  };
>  
> +static struct regulator_init_data gpo1_init = {
> +	.constraints = {
> +		.name = "GPO1",
> +	}
> +};
> +
> +static struct regulator_init_data gpo2_init = {
> +	.constraints = {
> +		.name = "GPO2",
> +	}
> +};
> +
> +static struct regulator_init_data gpo3_init = {
> +	.constraints = {
> +		.name = "GPO3",
> +	}
> +};
> +
> +static struct regulator_init_data gpo4_init = {
> +	.constraints = {
> +		.name = "GPO4",
> +	}
> +};
> +
>  static int mc13892_regulator_init(struct mc13892 *mc13892)
>  {
> +	printk("Initializing regulators for Babbage.\n");

ditto

-Bryan
>  	if (mxc_cpu_is_rev(CHIP_REV_2_0) < 0)
>  		sw2_init.constraints.state_mem.uV = 1100000;
>  
> @@ -240,6 +265,10 @@ static int mc13892_regulator_init(struct mc13892 *mc13892)
>  	mc13892_register_regulator(mc13892, MC13892_VGEN2, &vgen2_init);
>  	mc13892_register_regulator(mc13892, MC13892_VGEN3, &vgen3_init);
>  	mc13892_register_regulator(mc13892, MC13892_VUSB, &vusb_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO1, &gpo1_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO2, &gpo2_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO3, &gpo3_init);
> +	mc13892_register_regulator(mc13892, MC13892_GPO4, &gpo4_init);
>  
>  	return 0;
>  }





More information about the kernel-team mailing list