Commit bb887688 authored by Tony Lindgren's avatar Tony Lindgren

Merge branch 'for_3.4/cleanup/sr' of...

Merge branch 'for_3.4/cleanup/sr' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into sr
parents 149f1d5c 63371faf
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "omap_hwmod_common_data.h" #include "omap_hwmod_common_data.h"
#include "smartreflex.h"
#include "prm-regbits-34xx.h" #include "prm-regbits-34xx.h"
#include "cm-regbits-34xx.h" #include "cm-regbits-34xx.h"
#include "wd_timer.h" #include "wd_timer.h"
...@@ -376,6 +377,16 @@ static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = { ...@@ -376,6 +377,16 @@ static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = {
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = {
{ .irq = 18},
{ .irq = -1 }
};
static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = {
{ .irq = 19},
{ .irq = -1 }
};
/* L4 CORE -> SR1 interface */ /* L4 CORE -> SR1 interface */
static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = { static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
{ {
...@@ -2664,6 +2675,10 @@ static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = { ...@@ -2664,6 +2675,10 @@ static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
}; };
/* SR1 */ /* SR1 */
static struct omap_smartreflex_dev_attr sr1_dev_attr = {
.sensor_voltdm_name = "mpu_iva",
};
static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = { static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = {
&omap3_l4_core__sr1, &omap3_l4_core__sr1,
}; };
...@@ -2672,7 +2687,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = { ...@@ -2672,7 +2687,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
.name = "sr1_hwmod", .name = "sr1_hwmod",
.class = &omap34xx_smartreflex_hwmod_class, .class = &omap34xx_smartreflex_hwmod_class,
.main_clk = "sr1_fck", .main_clk = "sr1_fck",
.vdd_name = "mpu_iva",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
...@@ -2684,6 +2698,8 @@ static struct omap_hwmod omap34xx_sr1_hwmod = { ...@@ -2684,6 +2698,8 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
}, },
.slaves = omap3_sr1_slaves, .slaves = omap3_sr1_slaves,
.slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
.dev_attr = &sr1_dev_attr,
.mpu_irqs = omap3_smartreflex_mpu_irqs,
.flags = HWMOD_SET_DEFAULT_CLOCKACT, .flags = HWMOD_SET_DEFAULT_CLOCKACT,
}; };
...@@ -2691,7 +2707,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = { ...@@ -2691,7 +2707,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
.name = "sr1_hwmod", .name = "sr1_hwmod",
.class = &omap36xx_smartreflex_hwmod_class, .class = &omap36xx_smartreflex_hwmod_class,
.main_clk = "sr1_fck", .main_clk = "sr1_fck",
.vdd_name = "mpu_iva",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
...@@ -2703,9 +2718,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = { ...@@ -2703,9 +2718,15 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
}, },
.slaves = omap3_sr1_slaves, .slaves = omap3_sr1_slaves,
.slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
.dev_attr = &sr1_dev_attr,
.mpu_irqs = omap3_smartreflex_mpu_irqs,
}; };
/* SR2 */ /* SR2 */
static struct omap_smartreflex_dev_attr sr2_dev_attr = {
.sensor_voltdm_name = "core",
};
static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = { static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = {
&omap3_l4_core__sr2, &omap3_l4_core__sr2,
}; };
...@@ -2714,7 +2735,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = { ...@@ -2714,7 +2735,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
.name = "sr2_hwmod", .name = "sr2_hwmod",
.class = &omap34xx_smartreflex_hwmod_class, .class = &omap34xx_smartreflex_hwmod_class,
.main_clk = "sr2_fck", .main_clk = "sr2_fck",
.vdd_name = "core",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
...@@ -2726,6 +2746,8 @@ static struct omap_hwmod omap34xx_sr2_hwmod = { ...@@ -2726,6 +2746,8 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
}, },
.slaves = omap3_sr2_slaves, .slaves = omap3_sr2_slaves,
.slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
.dev_attr = &sr2_dev_attr,
.mpu_irqs = omap3_smartreflex_core_irqs,
.flags = HWMOD_SET_DEFAULT_CLOCKACT, .flags = HWMOD_SET_DEFAULT_CLOCKACT,
}; };
...@@ -2733,7 +2755,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = { ...@@ -2733,7 +2755,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
.name = "sr2_hwmod", .name = "sr2_hwmod",
.class = &omap36xx_smartreflex_hwmod_class, .class = &omap36xx_smartreflex_hwmod_class,
.main_clk = "sr2_fck", .main_clk = "sr2_fck",
.vdd_name = "core",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
...@@ -2745,6 +2766,8 @@ static struct omap_hwmod omap36xx_sr2_hwmod = { ...@@ -2745,6 +2766,8 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
}, },
.slaves = omap3_sr2_slaves, .slaves = omap3_sr2_slaves,
.slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
.dev_attr = &sr2_dev_attr,
.mpu_irqs = omap3_smartreflex_core_irqs,
}; };
/* /*
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "omap_hwmod_common_data.h" #include "omap_hwmod_common_data.h"
#include "smartreflex.h"
#include "cm1_44xx.h" #include "cm1_44xx.h"
#include "cm2_44xx.h" #include "cm2_44xx.h"
#include "prm44xx.h" #include "prm44xx.h"
...@@ -3963,6 +3964,10 @@ static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { ...@@ -3963,6 +3964,10 @@ static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
}; };
/* smartreflex_core */ /* smartreflex_core */
static struct omap_smartreflex_dev_attr smartreflex_core_dev_attr = {
.sensor_voltdm_name = "core",
};
static struct omap_hwmod omap44xx_smartreflex_core_hwmod; static struct omap_hwmod omap44xx_smartreflex_core_hwmod;
static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = { static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = {
{ .irq = 19 + OMAP44XX_IRQ_GIC_START }, { .irq = 19 + OMAP44XX_IRQ_GIC_START },
...@@ -3999,7 +4004,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { ...@@ -3999,7 +4004,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
.mpu_irqs = omap44xx_smartreflex_core_irqs, .mpu_irqs = omap44xx_smartreflex_core_irqs,
.main_clk = "smartreflex_core_fck", .main_clk = "smartreflex_core_fck",
.vdd_name = "core",
.prcm = { .prcm = {
.omap4 = { .omap4 = {
.clkctrl_offs = OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET, .clkctrl_offs = OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET,
...@@ -4009,9 +4013,14 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { ...@@ -4009,9 +4013,14 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
}, },
.slaves = omap44xx_smartreflex_core_slaves, .slaves = omap44xx_smartreflex_core_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
.dev_attr = &smartreflex_core_dev_attr,
}; };
/* smartreflex_iva */ /* smartreflex_iva */
static struct omap_smartreflex_dev_attr smartreflex_iva_dev_attr = {
.sensor_voltdm_name = "iva",
};
static struct omap_hwmod omap44xx_smartreflex_iva_hwmod; static struct omap_hwmod omap44xx_smartreflex_iva_hwmod;
static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = { static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = {
{ .irq = 102 + OMAP44XX_IRQ_GIC_START }, { .irq = 102 + OMAP44XX_IRQ_GIC_START },
...@@ -4047,7 +4056,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { ...@@ -4047,7 +4056,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
.clkdm_name = "l4_ao_clkdm", .clkdm_name = "l4_ao_clkdm",
.mpu_irqs = omap44xx_smartreflex_iva_irqs, .mpu_irqs = omap44xx_smartreflex_iva_irqs,
.main_clk = "smartreflex_iva_fck", .main_clk = "smartreflex_iva_fck",
.vdd_name = "iva",
.prcm = { .prcm = {
.omap4 = { .omap4 = {
.clkctrl_offs = OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET, .clkctrl_offs = OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET,
...@@ -4057,9 +4065,14 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { ...@@ -4057,9 +4065,14 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
}, },
.slaves = omap44xx_smartreflex_iva_slaves, .slaves = omap44xx_smartreflex_iva_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
.dev_attr = &smartreflex_iva_dev_attr,
}; };
/* smartreflex_mpu */ /* smartreflex_mpu */
static struct omap_smartreflex_dev_attr smartreflex_mpu_dev_attr = {
.sensor_voltdm_name = "mpu",
};
static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod; static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod;
static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = { static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = {
{ .irq = 18 + OMAP44XX_IRQ_GIC_START }, { .irq = 18 + OMAP44XX_IRQ_GIC_START },
...@@ -4095,7 +4108,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { ...@@ -4095,7 +4108,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
.clkdm_name = "l4_ao_clkdm", .clkdm_name = "l4_ao_clkdm",
.mpu_irqs = omap44xx_smartreflex_mpu_irqs, .mpu_irqs = omap44xx_smartreflex_mpu_irqs,
.main_clk = "smartreflex_mpu_fck", .main_clk = "smartreflex_mpu_fck",
.vdd_name = "mpu",
.prcm = { .prcm = {
.omap4 = { .omap4 = {
.clkctrl_offs = OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET, .clkctrl_offs = OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET,
...@@ -4105,6 +4117,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { ...@@ -4105,6 +4117,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
}, },
.slaves = omap44xx_smartreflex_mpu_slaves, .slaves = omap44xx_smartreflex_mpu_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
.dev_attr = &smartreflex_mpu_dev_attr,
}; };
/* /*
......
...@@ -29,6 +29,7 @@ static int sr_class3_enable(struct voltagedomain *voltdm) ...@@ -29,6 +29,7 @@ static int sr_class3_enable(struct voltagedomain *voltdm)
static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset) static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset)
{ {
sr_disable_errgen(voltdm);
omap_vp_disable(voltdm); omap_vp_disable(voltdm);
sr_disable(voltdm); sr_disable(voltdm);
if (is_volt_reset) if (is_volt_reset)
......
This diff is collapsed.
...@@ -152,6 +152,15 @@ struct omap_sr_pmic_data { ...@@ -152,6 +152,15 @@ struct omap_sr_pmic_data {
void (*sr_pmic_init) (void); void (*sr_pmic_init) (void);
}; };
/**
* struct omap_smartreflex_dev_attr - Smartreflex Device attribute.
*
* @sensor_voltdm_name: Name of voltdomain of SR instance
*/
struct omap_smartreflex_dev_attr {
const char *sensor_voltdm_name;
};
#ifdef CONFIG_OMAP_SMARTREFLEX #ifdef CONFIG_OMAP_SMARTREFLEX
/* /*
* The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR. * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
...@@ -231,6 +240,7 @@ void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); ...@@ -231,6 +240,7 @@ void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data);
int sr_enable(struct voltagedomain *voltdm, unsigned long volt); int sr_enable(struct voltagedomain *voltdm, unsigned long volt);
void sr_disable(struct voltagedomain *voltdm); void sr_disable(struct voltagedomain *voltdm);
int sr_configure_errgen(struct voltagedomain *voltdm); int sr_configure_errgen(struct voltagedomain *voltdm);
int sr_disable_errgen(struct voltagedomain *voltdm);
int sr_configure_minmax(struct voltagedomain *voltdm); int sr_configure_minmax(struct voltagedomain *voltdm);
/* API to register the smartreflex class driver with the smartreflex driver */ /* API to register the smartreflex class driver with the smartreflex driver */
......
...@@ -74,6 +74,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) ...@@ -74,6 +74,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
struct omap_sr_data *sr_data; struct omap_sr_data *sr_data;
struct platform_device *pdev; struct platform_device *pdev;
struct omap_volt_data *volt_data; struct omap_volt_data *volt_data;
struct omap_smartreflex_dev_attr *sr_dev_attr;
char *name = "smartreflex"; char *name = "smartreflex";
static int i; static int i;
...@@ -84,9 +85,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) ...@@ -84,9 +85,11 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
return -ENOMEM; return -ENOMEM;
} }
if (!oh->vdd_name) { sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr;
if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) {
pr_err("%s: No voltage domain specified for %s." pr_err("%s: No voltage domain specified for %s."
"Cannot initialize\n", __func__, oh->name); "Cannot initialize\n", __func__,
oh->name);
goto exit; goto exit;
} }
...@@ -94,10 +97,10 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) ...@@ -94,10 +97,10 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
sr_data->senn_mod = 0x1; sr_data->senn_mod = 0x1;
sr_data->senp_mod = 0x1; sr_data->senp_mod = 0x1;
sr_data->voltdm = voltdm_lookup(oh->vdd_name); sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name);
if (IS_ERR(sr_data->voltdm)) { if (IS_ERR(sr_data->voltdm)) {
pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
__func__, oh->vdd_name); __func__, sr_dev_attr->sensor_voltdm_name);
goto exit; goto exit;
} }
......
...@@ -484,7 +484,6 @@ struct omap_hwmod_class { ...@@ -484,7 +484,6 @@ struct omap_hwmod_class {
* @main_clk: main clock: OMAP clock name * @main_clk: main clock: OMAP clock name
* @_clk: pointer to the main struct clk (filled in at runtime) * @_clk: pointer to the main struct clk (filled in at runtime)
* @opt_clks: other device clocks that drivers can request (0..*) * @opt_clks: other device clocks that drivers can request (0..*)
* @vdd_name: voltage domain name
* @voltdm: pointer to voltage domain (filled in at runtime) * @voltdm: pointer to voltage domain (filled in at runtime)
* @masters: ptr to array of OCP ifs that this hwmod can initiate on * @masters: ptr to array of OCP ifs that this hwmod can initiate on
* @slaves: ptr to array of OCP ifs that this hwmod can respond on * @slaves: ptr to array of OCP ifs that this hwmod can respond on
...@@ -528,7 +527,6 @@ struct omap_hwmod { ...@@ -528,7 +527,6 @@ struct omap_hwmod {
struct omap_hwmod_opt_clk *opt_clks; struct omap_hwmod_opt_clk *opt_clks;
char *clkdm_name; char *clkdm_name;
struct clockdomain *clkdm; struct clockdomain *clkdm;
char *vdd_name;
struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ struct omap_hwmod_ocp_if **masters; /* connect to *_IA */
struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */
void *dev_attr; void *dev_attr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment