Lines Matching refs:sth
31 sth_channel(struct sth_device *sth, unsigned int master, unsigned int channel) in sth_channel() argument
33 struct intel_th_channel __iomem *sw_map = sth->channels; in sth_channel()
35 return &sw_map[(master - sth->stm.sw_start) * sth->stm.sw_nchannels + in sth_channel()
70 struct sth_device *sth = container_of(stm_data, struct sth_device, stm); in sth_stm_packet() local
72 sth_channel(sth, master, channel); in sth_stm_packet()
96 writeb_relaxed(*payload, sth->base + reg); in sth_stm_packet()
145 struct sth_device *sth = container_of(stm_data, struct sth_device, stm); in sth_stm_mmio_addr() local
148 master -= sth->stm.sw_start; in sth_stm_mmio_addr()
149 addr = sth->channels_phys + (master * sth->stm.sw_nchannels + channel) * in sth_stm_mmio_addr()
162 struct sth_device *sth = container_of(stm_data, struct sth_device, stm); in sth_stm_link() local
164 return intel_th_set_output(to_intel_th_device(sth->dev), master); in sth_stm_link()
167 static int intel_th_sw_init(struct sth_device *sth) in intel_th_sw_init() argument
171 reg = ioread32(sth->base + REG_STH_STHCAP1); in intel_th_sw_init()
172 sth->stm.sw_nchannels = reg & 0xff; in intel_th_sw_init()
174 reg = ioread32(sth->base + REG_STH_STHCAP0); in intel_th_sw_init()
175 sth->stm.sw_start = reg & 0xffff; in intel_th_sw_init()
176 sth->stm.sw_end = reg >> 16; in intel_th_sw_init()
178 sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start; in intel_th_sw_init()
179 dev_dbg(sth->dev, "sw_start: %x sw_end: %x masters: %x nchannels: %x\n", in intel_th_sw_init()
180 sth->stm.sw_start, sth->stm.sw_end, sth->sw_nmasters, in intel_th_sw_init()
181 sth->stm.sw_nchannels); in intel_th_sw_init()
189 struct sth_device *sth; in intel_th_sth_probe() local
210 sth = devm_kzalloc(dev, sizeof(*sth), GFP_KERNEL); in intel_th_sth_probe()
211 if (!sth) in intel_th_sth_probe()
214 sth->dev = dev; in intel_th_sth_probe()
215 sth->base = base; in intel_th_sth_probe()
216 sth->channels = channels; in intel_th_sth_probe()
217 sth->channels_phys = res->start; in intel_th_sth_probe()
218 sth->stm.name = dev_name(dev); in intel_th_sth_probe()
219 sth->stm.packet = sth_stm_packet; in intel_th_sth_probe()
220 sth->stm.mmio_addr = sth_stm_mmio_addr; in intel_th_sth_probe()
221 sth->stm.sw_mmiosz = sizeof(struct intel_th_channel); in intel_th_sth_probe()
222 sth->stm.link = sth_stm_link; in intel_th_sth_probe()
224 err = intel_th_sw_init(sth); in intel_th_sth_probe()
228 err = stm_register_device(dev, &sth->stm, THIS_MODULE); in intel_th_sth_probe()
234 dev_set_drvdata(dev, sth); in intel_th_sth_probe()
241 struct sth_device *sth = dev_get_drvdata(&thdev->dev); in intel_th_sth_remove() local
243 stm_unregister_device(&sth->stm); in intel_th_sth_remove()