Lines Matching refs:pti
52 struct pti_device *pti = dev_get_drvdata(dev); in mode_show() local
54 return scnprintf(buf, PAGE_SIZE, "%d\n", pti_mode[pti->mode]); in mode_show()
60 struct pti_device *pti = dev_get_drvdata(dev); in mode_store() local
72 pti->mode = ret; in mode_store()
83 struct pti_device *pti = dev_get_drvdata(dev); in freerunning_clock_show() local
85 return scnprintf(buf, PAGE_SIZE, "%d\n", pti->freeclk); in freerunning_clock_show()
92 struct pti_device *pti = dev_get_drvdata(dev); in freerunning_clock_store() local
100 pti->freeclk = !!val; in freerunning_clock_store()
111 struct pti_device *pti = dev_get_drvdata(dev); in clock_divider_show() local
113 return scnprintf(buf, PAGE_SIZE, "%d\n", 1u << pti->clkdiv); in clock_divider_show()
120 struct pti_device *pti = dev_get_drvdata(dev); in clock_divider_store() local
131 pti->clkdiv = val; in clock_divider_store()
151 struct pti_device *pti = dev_get_drvdata(&thdev->dev); in intel_th_pti_activate() local
154 if (pti->patgen) in intel_th_pti_activate()
155 ctl |= pti->patgen << __ffs(PTI_PATGENMODE); in intel_th_pti_activate()
156 if (pti->freeclk) in intel_th_pti_activate()
158 ctl |= pti->mode << __ffs(PTI_MODE); in intel_th_pti_activate()
159 ctl |= pti->clkdiv << __ffs(PTI_CLKDIV); in intel_th_pti_activate()
160 ctl |= pti->lpp_dest << __ffs(LPP_DEST); in intel_th_pti_activate()
162 iowrite32(ctl, pti->base + REG_PTI_CTL); in intel_th_pti_activate()
171 struct pti_device *pti = dev_get_drvdata(&thdev->dev); in intel_th_pti_deactivate() local
175 iowrite32(0, pti->base + REG_PTI_CTL); in intel_th_pti_deactivate()
178 static void read_hw_config(struct pti_device *pti) in read_hw_config() argument
180 u32 ctl = ioread32(pti->base + REG_PTI_CTL); in read_hw_config()
182 pti->mode = (ctl & PTI_MODE) >> __ffs(PTI_MODE); in read_hw_config()
183 pti->clkdiv = (ctl & PTI_CLKDIV) >> __ffs(PTI_CLKDIV); in read_hw_config()
184 pti->freeclk = !!(ctl & PTI_FCEN); in read_hw_config()
186 if (!pti_mode[pti->mode]) in read_hw_config()
187 pti->mode = pti_width_mode(4); in read_hw_config()
188 if (!pti->clkdiv) in read_hw_config()
189 pti->clkdiv = 1; in read_hw_config()
191 if (pti->thdev->output.type == GTH_LPP) { in read_hw_config()
193 pti->lpp_dest_mask |= LPP_DEST_PTI; in read_hw_config()
195 pti->lpp_dest_mask |= LPP_DEST_EXI; in read_hw_config()
197 pti->lpp_dest = 1; in read_hw_config()
205 struct pti_device *pti; in intel_th_pti_probe() local
216 pti = devm_kzalloc(dev, sizeof(*pti), GFP_KERNEL); in intel_th_pti_probe()
217 if (!pti) in intel_th_pti_probe()
220 pti->thdev = thdev; in intel_th_pti_probe()
221 pti->base = base; in intel_th_pti_probe()
223 read_hw_config(pti); in intel_th_pti_probe()
225 dev_set_drvdata(dev, pti); in intel_th_pti_probe()
251 struct pti_device *pti = dev_get_drvdata(dev); in lpp_dest_show() local
256 const char *fmt = pti->lpp_dest == i ? "[%s] " : "%s "; in lpp_dest_show()
258 if (!(pti->lpp_dest_mask & BIT(i))) in lpp_dest_show()
274 struct pti_device *pti = dev_get_drvdata(dev); in lpp_dest_store() local
281 if (!(pti->lpp_dest_mask & BIT(i))) in lpp_dest_store()
284 pti->lpp_dest = i; in lpp_dest_store()