/* * Different Smartreflex IPs version. The v1 is the 65nm version used in * OMAP3430. The v2 is the update for the 45nm version of the IP * used in OMAP3630 and OMAP4430
*/ #define SR_TYPE_V1 1 #define SR_TYPE_V2 2
/** * test_cond_timeout - busy-loop, testing a condition * @cond: condition to test until it evaluates to true * @timeout: maximum number of microseconds in the timeout * @index: loop index (integer) * * Loop waiting for @cond to become true or until at least @timeout * microseconds have passed. To use, define some integer @index in the * calling code. After running, if @index == @timeout, then the loop has * timed out. *
* Copied from omap_test_timeout */ #define sr_test_cond_timeout(cond, timeout, index) \
({ \ for (index = 0; index < timeout; index++) { \ if (cond) \ break; \
udelay(1); \
} \
})
/** * struct omap_sr_pmic_data - Strucutre to be populated by pmic code to pass * pmic specific info to smartreflex driver * * @sr_pmic_init: API to initialize smartreflex on the PMIC side.
*/ struct omap_sr_pmic_data { 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 { constchar *sensor_voltdm_name;
};
/* * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR. * The smartreflex class driver should pass the class type. * Should be used to populate the class_type field of the * omap_smartreflex_class_data structure.
*/ #define SR_CLASS1 0x1 #define SR_CLASS2 0x2 #define SR_CLASS3 0x3
/** * struct omap_sr_class_data - Smartreflex class driver info * * @enable: API to enable a particular class smaartreflex. * @disable: API to disable a particular class smartreflex. * @configure: API to configure a particular class smartreflex. * @notify: API to notify the class driver about an event in SR. * Not needed for class3. * @notify_flags: specify the events to be notified to the class driver * @class_type: specify which smartreflex class. * Can be used by the SR driver to take any class * based decisions.
*/ struct omap_sr_class_data { int (*enable)(struct omap_sr *sr); int (*disable)(struct omap_sr *sr, int is_volt_reset); int (*configure)(struct omap_sr *sr); int (*notify)(struct omap_sr *sr, u32 status);
u8 notify_flags;
u8 class_type;
};
/** * struct omap_sr_nvalue_table - Smartreflex n-target value info * * @efuse_offs: The offset of the efuse where n-target values are stored. * @nvalue: The n-target value. * @errminlimit: The value of the ERRMINLIMIT bitfield for this n-target * @volt_nominal: microvolts DC that the VDD is initially programmed to
*/ struct omap_sr_nvalue_table {
u32 efuse_offs;
u32 nvalue;
u32 errminlimit; unsignedlong volt_nominal;
};
/** * struct omap_sr_data - Smartreflex platform data. * * @name: instance name * @ip_type: Smartreflex IP type. * @senp_mod: SENPENABLE value of the sr CONFIG register * @senn_mod: SENNENABLE value for sr CONFIG register * @err_weight ERRWEIGHT value of the sr ERRCONFIG register * @err_maxlimit ERRMAXLIMIT value of the sr ERRCONFIG register * @accum_data ACCUMDATA value of the sr CONFIG register * @senn_avgweight SENNAVGWEIGHT value of the sr AVGWEIGHT register * @senp_avgweight SENPAVGWEIGHT value of the sr AVGWEIGHT register * @nvalue_count: Number of distinct nvalues in the nvalue table * @nvalue_table: table containing the efuse offsets and nvalues * corresponding to them. * @voltdm: Pointer to the voltage domain associated with the SR
*/ struct omap_sr_data { constchar *name; int ip_type;
u32 senp_mod;
u32 senn_mod;
u32 err_weight;
u32 err_maxlimit;
u32 accum_data;
u32 senn_avgweight;
u32 senp_avgweight; int nvalue_count; struct omap_sr_nvalue_table *nvalue_table; struct voltagedomain *voltdm;
};
/* Smartreflex driver hooks to be called from Smartreflex class driver */ int sr_enable(struct omap_sr *sr, unsignedlong volt); void sr_disable(struct omap_sr *sr); int sr_configure_errgen(struct omap_sr *sr); int sr_disable_errgen(struct omap_sr *sr); int sr_configure_minmax(struct omap_sr *sr);
/* API to register the smartreflex class driver with the smartreflex driver */ int sr_register_class(struct omap_sr_class_data *class_data); #else staticinlinevoid omap_sr_enable(struct voltagedomain *voltdm) {} staticinlinevoid omap_sr_disable(struct voltagedomain *voltdm) {} staticinlinevoid omap_sr_disable_reset_volt( struct voltagedomain *voltdm) {} #endif #endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.