Skip to content

Commit d060b40

Browse files
committed
ARM: OMAP2+: Prepare to pass auxdata for smartreflex
We are still initializing smartreflex with platform data using omap_device_build(). We can instead pass the platform data in with auxdata in pdata-quirks.c and make the driver use that in later patches. Note that we cannot enable the auxdata use yet, this is done in the last patch of the series. Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 7928b2c commit d060b40

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

‎arch/arm/mach-omap2/pdata-quirks.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/wl12xx.h>
1818
#include <linux/mmc/card.h>
1919
#include <linux/mmc/host.h>
20+
#include <linux/power/smartreflex.h>
2021
#include <linux/regulator/machine.h>
2122
#include <linux/regulator/fixed.h>
2223

@@ -542,6 +543,8 @@ static struct pdata_init auxdata_quirks[] __initdata = {
542543
{ /* sentinel */ },
543544
};
544545

546+
struct omap_sr_data __maybe_unused omap_sr_pdata[OMAP_SR_NR];
547+
545548
static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
546549
#ifdef CONFIG_MACH_NOKIA_N8X0
547550
OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
@@ -551,6 +554,10 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
551554
#ifdef CONFIG_ARCH_OMAP3
552555
OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
553556
&omap3_iommu_pdata),
557+
OF_DEV_AUXDATA("ti,omap3-smartreflex-core", 0x480cb000,
558+
"480cb000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
559+
OF_DEV_AUXDATA("ti,omap3-smartreflex-mpu-iva", 0x480c9000,
560+
"480c9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]),
554561
OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
555562
OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
556563
OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data),
@@ -580,6 +587,12 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
580587
&omap4_iommu_pdata),
581588
OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
582589
&omap4_iommu_pdata),
590+
OF_DEV_AUXDATA("ti,omap4-smartreflex-iva", 0x4a0db000,
591+
"4a0db000.smartreflex", &omap_sr_pdata[OMAP_SR_IVA]),
592+
OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000,
593+
"4a0dd000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
594+
OF_DEV_AUXDATA("ti,omap4-smartreflex-mpu", 0x4a0d9000,
595+
"4a0d9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]),
583596
#endif
584597
#ifdef CONFIG_SOC_DRA7XX
585598
OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x4809c000, "4809c000.mmc",

‎arch/arm/mach-omap2/sr_device.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
8989
sr_data->nvalue_count = j;
9090
}
9191

92+
extern struct omap_sr_data omap_sr_pdata[];
93+
9294
static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
9395
{
9496
struct omap_sr_data *sr_data;

‎include/linux/power/smartreflex.h‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@
143143
#define OMAP3430_SR_ERRWEIGHT 0x04
144144
#define OMAP3430_SR_ERRMAXLIMIT 0x02
145145

146+
enum sr_instance {
147+
OMAP_SR_MPU, /* shared with iva on omap3 */
148+
OMAP_SR_CORE,
149+
OMAP_SR_IVA,
150+
OMAP_SR_NR,
151+
};
152+
146153
struct omap_sr {
147154
char *name;
148155
struct list_head node;
@@ -207,7 +214,6 @@ struct omap_smartreflex_dev_attr {
207214
const char *sensor_voltdm_name;
208215
};
209216

210-
#ifdef CONFIG_POWER_AVS_OMAP
211217
/*
212218
* The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
213219
* The smartreflex class driver should pass the class type.
@@ -290,6 +296,8 @@ struct omap_sr_data {
290296
struct voltagedomain *voltdm;
291297
};
292298

299+
#ifdef CONFIG_POWER_AVS_OMAP
300+
293301
/* Smartreflex module enable/disable interface */
294302
void omap_sr_enable(struct voltagedomain *voltdm);
295303
void omap_sr_disable(struct voltagedomain *voltdm);

0 commit comments

Comments
 (0)