gth                33 drivers/hwtracing/intel_th/gth.c 	struct gth_device	*gth;
gth                61 drivers/hwtracing/intel_th/gth.c static void gth_output_set(struct gth_device *gth, int port,
gth                68 drivers/hwtracing/intel_th/gth.c 	val = ioread32(gth->base + reg);
gth                71 drivers/hwtracing/intel_th/gth.c 	iowrite32(val, gth->base + reg);
gth                74 drivers/hwtracing/intel_th/gth.c static unsigned int gth_output_get(struct gth_device *gth, int port)
gth                80 drivers/hwtracing/intel_th/gth.c 	val = ioread32(gth->base + reg);
gth                87 drivers/hwtracing/intel_th/gth.c static void gth_smcfreq_set(struct gth_device *gth, int port,
gth                94 drivers/hwtracing/intel_th/gth.c 	val = ioread32(gth->base + reg);
gth                97 drivers/hwtracing/intel_th/gth.c 	iowrite32(val, gth->base + reg);
gth               100 drivers/hwtracing/intel_th/gth.c static unsigned int gth_smcfreq_get(struct gth_device *gth, int port)
gth               106 drivers/hwtracing/intel_th/gth.c 	val = ioread32(gth->base + reg);
gth               119 drivers/hwtracing/intel_th/gth.c 	struct gth_device	*gth;
gth               124 drivers/hwtracing/intel_th/gth.c gth_master_set(struct gth_device *gth, unsigned int master, int port)
gth               135 drivers/hwtracing/intel_th/gth.c 	val = ioread32(gth->base + reg);
gth               139 drivers/hwtracing/intel_th/gth.c 	iowrite32(val, gth->base + reg);
gth               148 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = ma->gth;
gth               152 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               153 drivers/hwtracing/intel_th/gth.c 	port = gth->master[ma->master];
gth               154 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               170 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = ma->gth;
gth               179 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               182 drivers/hwtracing/intel_th/gth.c 	old_port = gth->master[ma->master];
gth               184 drivers/hwtracing/intel_th/gth.c 		gth->master[ma->master] = -1;
gth               185 drivers/hwtracing/intel_th/gth.c 		clear_bit(ma->master, gth->output[old_port].master);
gth               191 drivers/hwtracing/intel_th/gth.c 		if (gth->output[old_port].output->active)
gth               192 drivers/hwtracing/intel_th/gth.c 			gth_master_set(gth, ma->master, -1);
gth               198 drivers/hwtracing/intel_th/gth.c 		if (!gth->output[port].output) {
gth               203 drivers/hwtracing/intel_th/gth.c 		set_bit(ma->master, gth->output[port].master);
gth               206 drivers/hwtracing/intel_th/gth.c 		if (gth->output[port].output->active)
gth               207 drivers/hwtracing/intel_th/gth.c 			gth_master_set(gth, ma->master, port);
gth               210 drivers/hwtracing/intel_th/gth.c 	gth->master[ma->master] = port;
gth               213 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               220 drivers/hwtracing/intel_th/gth.c 	struct gth_device	*gth;
gth               235 drivers/hwtracing/intel_th/gth.c 	unsigned int	(*get)(struct gth_device *gth, int port);
gth               236 drivers/hwtracing/intel_th/gth.c 	void		(*set)(struct gth_device *gth, int port,
gth               251 drivers/hwtracing/intel_th/gth.c gth_output_parm_set(struct gth_device *gth, int port, unsigned int parm,
gth               254 drivers/hwtracing/intel_th/gth.c 	unsigned int config = output_parms[parm].get(gth, port);
gth               260 drivers/hwtracing/intel_th/gth.c 	output_parms[parm].set(gth, port, config);
gth               264 drivers/hwtracing/intel_th/gth.c gth_output_parm_get(struct gth_device *gth, int port, unsigned int parm)
gth               266 drivers/hwtracing/intel_th/gth.c 	unsigned int config = output_parms[parm].get(gth, port);
gth               278 drivers/hwtracing/intel_th/gth.c static int intel_th_gth_reset(struct gth_device *gth)
gth               283 drivers/hwtracing/intel_th/gth.c 	reg = ioread32(gth->base + REG_GTH_SCRPD0);
gth               289 drivers/hwtracing/intel_th/gth.c 	iowrite32(reg, gth->base + REG_GTH_SCRPD0);
gth               293 drivers/hwtracing/intel_th/gth.c 		if (gth_output_parm_get(gth, port, TH_OUTPUT_PARM(port)) ==
gth               297 drivers/hwtracing/intel_th/gth.c 		gth_output_set(gth, port, 0);
gth               298 drivers/hwtracing/intel_th/gth.c 		gth_smcfreq_set(gth, port, 16);
gth               301 drivers/hwtracing/intel_th/gth.c 	iowrite32(0, gth->base + REG_GTH_DESTOVR);
gth               305 drivers/hwtracing/intel_th/gth.c 		iowrite32(0, gth->base + REG_GTH_SWDEST0 + i * 4);
gth               308 drivers/hwtracing/intel_th/gth.c 	iowrite32(0, gth->base + REG_GTH_SCR);
gth               309 drivers/hwtracing/intel_th/gth.c 	iowrite32(0xfc, gth->base + REG_GTH_SCR2);
gth               312 drivers/hwtracing/intel_th/gth.c 	iowrite32(CTS_EVENT_ENABLE_IF_ANYTHING, gth->base + REG_CTS_C0S0_EN);
gth               314 drivers/hwtracing/intel_th/gth.c 		  CTS_ACTION_CONTROL_TRIGGER, gth->base + REG_CTS_C0S0_ACT);
gth               329 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = oa->gth;
gth               334 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               336 drivers/hwtracing/intel_th/gth.c 			 gth_output_parm_get(gth, oa->port, oa->parm));
gth               337 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               350 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = oa->gth;
gth               358 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               359 drivers/hwtracing/intel_th/gth.c 	gth_output_parm_set(gth, oa->port, oa->parm, config);
gth               360 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               367 drivers/hwtracing/intel_th/gth.c static int intel_th_master_attributes(struct gth_device *gth)
gth               373 drivers/hwtracing/intel_th/gth.c 	attrs = devm_kcalloc(gth->dev, nattrs, sizeof(void *), GFP_KERNEL);
gth               377 drivers/hwtracing/intel_th/gth.c 	master_attrs = devm_kcalloc(gth->dev, nattrs,
gth               386 drivers/hwtracing/intel_th/gth.c 		name = devm_kasprintf(gth->dev, GFP_KERNEL, "%d%s", i,
gth               399 drivers/hwtracing/intel_th/gth.c 		master_attrs[i].gth = gth;
gth               403 drivers/hwtracing/intel_th/gth.c 	gth->master_group.name	= "masters";
gth               404 drivers/hwtracing/intel_th/gth.c 	gth->master_group.attrs = attrs;
gth               406 drivers/hwtracing/intel_th/gth.c 	return sysfs_create_group(&gth->dev->kobj, &gth->master_group);
gth               409 drivers/hwtracing/intel_th/gth.c static int intel_th_output_attributes(struct gth_device *gth)
gth               417 drivers/hwtracing/intel_th/gth.c 	attrs = devm_kcalloc(gth->dev, nattrs, sizeof(void *), GFP_KERNEL);
gth               421 drivers/hwtracing/intel_th/gth.c 	out_attrs = devm_kcalloc(gth->dev, nattrs,
gth               432 drivers/hwtracing/intel_th/gth.c 			name = devm_kasprintf(gth->dev, GFP_KERNEL, "%d_%s", i,
gth               452 drivers/hwtracing/intel_th/gth.c 			out_attrs[idx].gth = gth;
gth               458 drivers/hwtracing/intel_th/gth.c 	gth->output_group.name	= "outputs";
gth               459 drivers/hwtracing/intel_th/gth.c 	gth->output_group.attrs = attrs;
gth               461 drivers/hwtracing/intel_th/gth.c 	return sysfs_create_group(&gth->dev->kobj, &gth->output_group);
gth               473 drivers/hwtracing/intel_th/gth.c static void intel_th_gth_stop(struct gth_device *gth,
gth               485 drivers/hwtracing/intel_th/gth.c 	iowrite32(0, gth->base + REG_GTH_SCR);
gth               486 drivers/hwtracing/intel_th/gth.c 	iowrite32(scr2, gth->base + REG_GTH_SCR2);
gth               491 drivers/hwtracing/intel_th/gth.c 		reg = ioread32(gth->base + REG_GTH_STAT);
gth               496 drivers/hwtracing/intel_th/gth.c 		dev_dbg(gth->dev, "timeout waiting for GTH[%d] PLE\n",
gth               504 drivers/hwtracing/intel_th/gth.c 	iowrite32(0xfc, gth->base + REG_GTH_SCR2);
gth               514 drivers/hwtracing/intel_th/gth.c static void intel_th_gth_start(struct gth_device *gth,
gth               522 drivers/hwtracing/intel_th/gth.c 	iowrite32(scr, gth->base + REG_GTH_SCR);
gth               523 drivers/hwtracing/intel_th/gth.c 	iowrite32(0, gth->base + REG_GTH_SCR2);
gth               538 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               542 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               545 drivers/hwtracing/intel_th/gth.c 	for_each_set_bit(master, gth->output[output->port].master,
gth               547 drivers/hwtracing/intel_th/gth.c 		gth_master_set(gth, master, -1);
gth               549 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               551 drivers/hwtracing/intel_th/gth.c 	intel_th_gth_stop(gth, output, true);
gth               553 drivers/hwtracing/intel_th/gth.c 	reg = ioread32(gth->base + REG_GTH_SCRPD0);
gth               555 drivers/hwtracing/intel_th/gth.c 	iowrite32(reg, gth->base + REG_GTH_SCRPD0);
gth               558 drivers/hwtracing/intel_th/gth.c static void gth_tscu_resync(struct gth_device *gth)
gth               562 drivers/hwtracing/intel_th/gth.c 	reg = ioread32(gth->base + REG_TSCU_TSUCTRL);
gth               564 drivers/hwtracing/intel_th/gth.c 	iowrite32(reg, gth->base + REG_TSCU_TSUCTRL);
gth               578 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               583 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               584 drivers/hwtracing/intel_th/gth.c 	for_each_set_bit(master, gth->output[output->port].master,
gth               586 drivers/hwtracing/intel_th/gth.c 		gth_master_set(gth, master, output->port);
gth               590 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               593 drivers/hwtracing/intel_th/gth.c 		gth_tscu_resync(gth);
gth               595 drivers/hwtracing/intel_th/gth.c 	scrpd = ioread32(gth->base + REG_GTH_SCRPD0);
gth               597 drivers/hwtracing/intel_th/gth.c 	iowrite32(scrpd, gth->base + REG_GTH_SCRPD0);
gth               599 drivers/hwtracing/intel_th/gth.c 	intel_th_gth_start(gth, output);
gth               613 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               618 drivers/hwtracing/intel_th/gth.c 	iowrite32(0, gth->base + REG_CTS_CTL);
gth               619 drivers/hwtracing/intel_th/gth.c 	iowrite32(CTS_CTL_SEQUENCER_ENABLE, gth->base + REG_CTS_CTL);
gth               623 drivers/hwtracing/intel_th/gth.c 		reg = ioread32(gth->base + REG_CTS_STAT);
gth               630 drivers/hwtracing/intel_th/gth.c 	iowrite32(0, gth->base + REG_CTS_CTL);
gth               632 drivers/hwtracing/intel_th/gth.c 	intel_th_gth_stop(gth, output, false);
gth               633 drivers/hwtracing/intel_th/gth.c 	intel_th_gth_start(gth, output);
gth               650 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               660 drivers/hwtracing/intel_th/gth.c 		if (gth->output[i].port_type != othdev->output.type)
gth               672 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               675 drivers/hwtracing/intel_th/gth.c 	gth->output[i].output = &othdev->output;
gth               676 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               689 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               696 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               699 drivers/hwtracing/intel_th/gth.c 	gth->output[port].output = NULL;
gth               701 drivers/hwtracing/intel_th/gth.c 		if (gth->master[master] == port)
gth               702 drivers/hwtracing/intel_th/gth.c 			gth->master[master] = -1;
gth               703 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               709 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               719 drivers/hwtracing/intel_th/gth.c 	spin_lock(&gth->gth_lock);
gth               720 drivers/hwtracing/intel_th/gth.c 	if (gth->master[master] == -1) {
gth               721 drivers/hwtracing/intel_th/gth.c 		set_bit(master, gth->output[port].master);
gth               722 drivers/hwtracing/intel_th/gth.c 		gth->master[master] = port;
gth               724 drivers/hwtracing/intel_th/gth.c 	spin_unlock(&gth->gth_lock);
gth               733 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth;
gth               746 drivers/hwtracing/intel_th/gth.c 	gth = devm_kzalloc(dev, sizeof(*gth), GFP_KERNEL);
gth               747 drivers/hwtracing/intel_th/gth.c 	if (!gth)
gth               750 drivers/hwtracing/intel_th/gth.c 	gth->dev = dev;
gth               751 drivers/hwtracing/intel_th/gth.c 	gth->base = base;
gth               752 drivers/hwtracing/intel_th/gth.c 	spin_lock_init(&gth->gth_lock);
gth               754 drivers/hwtracing/intel_th/gth.c 	dev_set_drvdata(dev, gth);
gth               765 drivers/hwtracing/intel_th/gth.c 	ret = intel_th_gth_reset(gth);
gth               776 drivers/hwtracing/intel_th/gth.c 		gth->master[i] = -1;
gth               779 drivers/hwtracing/intel_th/gth.c 		gth->output[i].gth = gth;
gth               780 drivers/hwtracing/intel_th/gth.c 		gth->output[i].index = i;
gth               781 drivers/hwtracing/intel_th/gth.c 		gth->output[i].port_type =
gth               782 drivers/hwtracing/intel_th/gth.c 			gth_output_parm_get(gth, i, TH_OUTPUT_PARM(port));
gth               783 drivers/hwtracing/intel_th/gth.c 		if (gth->output[i].port_type == GTH_NONE)
gth               786 drivers/hwtracing/intel_th/gth.c 		ret = intel_th_output_enable(th, gth->output[i].port_type);
gth               792 drivers/hwtracing/intel_th/gth.c 	if (intel_th_output_attributes(gth) ||
gth               793 drivers/hwtracing/intel_th/gth.c 	    intel_th_master_attributes(gth)) {
gth               796 drivers/hwtracing/intel_th/gth.c 		if (gth->output_group.attrs)
gth               797 drivers/hwtracing/intel_th/gth.c 			sysfs_remove_group(&gth->dev->kobj, &gth->output_group);
gth               806 drivers/hwtracing/intel_th/gth.c 	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
gth               808 drivers/hwtracing/intel_th/gth.c 	sysfs_remove_group(&gth->dev->kobj, &gth->output_group);
gth               809 drivers/hwtracing/intel_th/gth.c 	sysfs_remove_group(&gth->dev->kobj, &gth->master_group);