/* struct mtk_pll_data - hardware-specific PLLs data */
struct mtk_pll_data {
+ /* unmapped ID of clock */
const int id;
u32 reg;
u32 pwr_reg;
/**
* struct mtk_fixed_clk - fixed clocks
*
- * @id: index of clocks
- * @parent: index of parnet clocks
+ * @id: unmapped ID of clock
+ * @parent: unmapped ID of parent clock
* @rate: fixed rate
*/
struct mtk_fixed_clk {
/**
* struct mtk_fixed_factor - fixed multiplier and divider clocks
*
- * @id: index of clocks
- * @parent: index of parnet clocks
+ * @id: unmapped ID of clock
+ * @parent: unmapped ID of parent clock
* @mult: multiplier
* @div: divider
* @flag: hardware-specific flags
* struct mtk_parent - clock parent with flags. Needed for MUX that
* parent with mixed infracfg and topckgen.
*
- * @id: index of parent clocks
+ * @id: unmapped ID of parent clocks
* @flags: hardware-specific flags (parent location,
* infracfg, topckgen, APMIXED, xtal ...)
*/
/**
* struct mtk_composite - aggregate clock of mux, divider and gate clocks
*
- * @id: index of clocks
- * @parent: index of parent clocks
+ * @id: unmapped ID of clocks
+ * @parent: unmapped ID of parent clocks
* @parent_flags: table of parent clocks with flags
* @mux_reg: hardware-specific mux register
* @gate_reg: hardware-specific gate register
/**
* struct mtk_gate - gate clocks
*
- * @id: index of gate clocks
- * @parent: index of parnet clocks
+ * @id: unmapped ID of gate clocks
+ * @parent: unmapped ID of parent clocks
* @regs: hardware-specific mux register
* @shift: shift to the gate bit field
* @flags: hardware-specific flags
unsigned long xtal_rate;
unsigned long xtal2_rate;
/*
- * Clock ID offset are remapped with an auxiliary table.
- * Enable this by defining .id_offs_map.
- * This is needed for upstream linux kernel <soc>-clk.h that
- * have mixed clk ID and doesn't have clear distinction between
- * ID for factor, mux and gates.
+ * Clock IDs may be remapped with an auxiliary table. Enable this by
+ * defining .id_offs_map and .id_offs_map_size. This is needed e.g. when
+ * the upstream Linux kernel <soc>-clk.h has mixed clk IDs and doesn't
+ * have clear distinction between ID for factor, mux and gates. When
+ * this is enabled, the struct clk->id will contained the mapped ID that
+ * is the index in the various arrays in this struct. The .id and
+ * .parent fields in the various mtk_* structs will contain the
+ * unmapped IDs as defined in the upstream Linux kernel <soc>-clk.h.
*/
- const int *id_offs_map; /* optional, table clk.h to driver ID */
+ const int *id_offs_map; /* optional, maps clk.h ID to array index */
const int id_offs_map_size;
const int fdivs_offs;
const int muxes_offs;