Lines Matching full:pmc

14 #include <linux/platform_data/x86/clk-pmc-atom.h>
203 static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset) in pmc_reg_read() argument
205 return readl(pmc->regmap + reg_offset); in pmc_reg_read()
208 static inline void pmc_reg_write(struct pmc_dev *pmc, int reg_offset, u32 val) in pmc_reg_write() argument
210 writel(val, pmc->regmap + reg_offset); in pmc_reg_write()
215 struct pmc_dev *pmc = &pmc_device; in pmc_atom_read() local
217 if (!pmc->init) in pmc_atom_read()
220 *value = pmc_reg_read(pmc, offset); in pmc_atom_read()
227 struct pmc_dev *pmc = &pmc_device; in pmc_atom_write() local
229 if (!pmc->init) in pmc_atom_write()
232 pmc_reg_write(pmc, offset, value); in pmc_atom_write()
254 static void pmc_hw_reg_setup(struct pmc_dev *pmc) in pmc_hw_reg_setup() argument
257 * Disable PMC S0IX_WAKE_EN events coming from: in pmc_hw_reg_setup()
264 pmc_reg_write(pmc, PMC_S0IX_WAKE_EN, (u32)PMC_WAKE_EN_SETTING); in pmc_hw_reg_setup()
285 struct pmc_dev *pmc = s->private; in pmc_dev_state_show() local
286 const struct pmc_reg_map *m = pmc->map; in pmc_dev_state_show()
290 func_dis = pmc_reg_read(pmc, PMC_FUNC_DIS); in pmc_dev_state_show()
291 func_dis_2 = pmc_reg_read(pmc, PMC_FUNC_DIS_2); in pmc_dev_state_show()
292 d3_sts_0 = pmc_reg_read(pmc, PMC_D3_STS_0); in pmc_dev_state_show()
293 d3_sts_1 = pmc_reg_read(pmc, PMC_D3_STS_1); in pmc_dev_state_show()
308 struct pmc_dev *pmc = s->private; in pmc_pss_state_show() local
309 const struct pmc_bit_map *map = pmc->map->pss; in pmc_pss_state_show()
310 u32 pss = pmc_reg_read(pmc, PMC_PSS); in pmc_pss_state_show()
325 struct pmc_dev *pmc = s->private; in pmc_sleep_tmr_show() local
328 s0ir_tmr = (u64)pmc_reg_read(pmc, PMC_S0IR_TMR) << PMC_TMR_SHIFT; in pmc_sleep_tmr_show()
329 s0i1_tmr = (u64)pmc_reg_read(pmc, PMC_S0I1_TMR) << PMC_TMR_SHIFT; in pmc_sleep_tmr_show()
330 s0i2_tmr = (u64)pmc_reg_read(pmc, PMC_S0I2_TMR) << PMC_TMR_SHIFT; in pmc_sleep_tmr_show()
331 s0i3_tmr = (u64)pmc_reg_read(pmc, PMC_S0I3_TMR) << PMC_TMR_SHIFT; in pmc_sleep_tmr_show()
332 s0_tmr = (u64)pmc_reg_read(pmc, PMC_S0_TMR) << PMC_TMR_SHIFT; in pmc_sleep_tmr_show()
344 static void pmc_dbgfs_register(struct pmc_dev *pmc) in pmc_dbgfs_register() argument
350 pmc->dbgfs_dir = dir; in pmc_dbgfs_register()
352 debugfs_create_file("dev_state", S_IFREG | S_IRUGO, dir, pmc, in pmc_dbgfs_register()
354 debugfs_create_file("pss_state", S_IFREG | S_IRUGO, dir, pmc, in pmc_dbgfs_register()
356 debugfs_create_file("sleep_state", S_IFREG | S_IRUGO, dir, pmc, in pmc_dbgfs_register()
360 static void pmc_dbgfs_register(struct pmc_dev *pmc) in pmc_dbgfs_register() argument
469 clkdev = platform_device_register_data(&pdev->dev, "clk-pmc-atom", in pmc_setup_clks()
484 struct pmc_dev *pmc = &pmc_device; in pmc_setup_dev() local
497 pci_read_config_dword(pdev, PMC_BASE_ADDR_OFFSET, &pmc->base_addr); in pmc_setup_dev()
498 pmc->base_addr &= PMC_BASE_ADDR_MASK; in pmc_setup_dev()
500 pmc->regmap = ioremap(pmc->base_addr, PMC_MMIO_REG_LEN); in pmc_setup_dev()
501 if (!pmc->regmap) { in pmc_setup_dev()
506 pmc->map = map; in pmc_setup_dev()
508 /* PMC hardware registers setup */ in pmc_setup_dev()
509 pmc_hw_reg_setup(pmc); in pmc_setup_dev()
511 pmc_dbgfs_register(pmc); in pmc_setup_dev()
514 ret = pmc_setup_clks(pdev, pmc->regmap, data); in pmc_setup_dev()
519 pmc->init = true; in pmc_setup_dev()
539 /* We look for our device - PCU PMC in pmc_atom_init()