twl               414 drivers/mfd/twl-core.c 	struct twl_client *twl;
twl               426 drivers/mfd/twl-core.c 	twl = &twl_priv->twl_modules[sid];
twl               428 drivers/mfd/twl-core.c 	return twl->regmap;
twl               600 drivers/mfd/twl-core.c 	struct twl_client	*twl;
twl               608 drivers/mfd/twl-core.c 	twl = &twl_priv->twl_modules[sid];
twl               614 drivers/mfd/twl-core.c 	pdev->dev.parent = &twl->client->dev;
twl               647 drivers/mfd/twl-core.c 	dev_err(&twl->client->dev, "failed to add device %s\n", name);
twl              1051 drivers/mfd/twl-core.c 		struct twl_client	*twl = &twl_priv->twl_modules[i];
twl              1053 drivers/mfd/twl-core.c 		if (twl->client && twl->client != client)
twl              1054 drivers/mfd/twl-core.c 			i2c_unregister_device(twl->client);
twl              1055 drivers/mfd/twl-core.c 		twl->client = NULL;
twl              1139 drivers/mfd/twl-core.c 		struct twl_client *twl = &twl_priv->twl_modules[i];
twl              1142 drivers/mfd/twl-core.c 			twl->client = client;
twl              1144 drivers/mfd/twl-core.c 			twl->client = i2c_new_dummy_device(client->adapter,
twl              1146 drivers/mfd/twl-core.c 			if (IS_ERR(twl->client)) {
twl              1149 drivers/mfd/twl-core.c 				status = PTR_ERR(twl->client);
twl              1154 drivers/mfd/twl-core.c 		twl->regmap = devm_regmap_init_i2c(twl->client,
twl              1156 drivers/mfd/twl-core.c 		if (IS_ERR(twl->regmap)) {
twl              1157 drivers/mfd/twl-core.c 			status = PTR_ERR(twl->regmap);
twl               174 drivers/phy/ti/phy-twl4030-usb.c static int twl4030_i2c_write_u8_verify(struct twl4030_usb *twl,
twl               183 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "Write%d[%d,0x%x] wrote %02x but read %02x\n",
twl               191 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "Write%d[%d,0x%x] wrote %02x but read %02x\n",
twl               198 drivers/phy/ti/phy-twl4030-usb.c #define twl4030_usb_write_verify(twl, address, data)	\
twl               199 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_i2c_write_u8_verify(twl, TWL_MODULE_USB, (data), (address))
twl               201 drivers/phy/ti/phy-twl4030-usb.c static inline int twl4030_usb_write(struct twl4030_usb *twl,
twl               208 drivers/phy/ti/phy-twl4030-usb.c 		dev_dbg(twl->dev,
twl               213 drivers/phy/ti/phy-twl4030-usb.c static inline int twl4030_readb(struct twl4030_usb *twl, u8 module, u8 address)
twl               222 drivers/phy/ti/phy-twl4030-usb.c 		dev_dbg(twl->dev,
twl               229 drivers/phy/ti/phy-twl4030-usb.c static inline int twl4030_usb_read(struct twl4030_usb *twl, u8 address)
twl               231 drivers/phy/ti/phy-twl4030-usb.c 	return twl4030_readb(twl, TWL_MODULE_USB, address);
twl               237 drivers/phy/ti/phy-twl4030-usb.c twl4030_usb_set_bits(struct twl4030_usb *twl, u8 reg, u8 bits)
twl               239 drivers/phy/ti/phy-twl4030-usb.c 	return twl4030_usb_write(twl, ULPI_SET(reg), bits);
twl               243 drivers/phy/ti/phy-twl4030-usb.c twl4030_usb_clear_bits(struct twl4030_usb *twl, u8 reg, u8 bits)
twl               245 drivers/phy/ti/phy-twl4030-usb.c 	return twl4030_usb_write(twl, ULPI_CLR(reg), bits);
twl               250 drivers/phy/ti/phy-twl4030-usb.c static bool twl4030_is_driving_vbus(struct twl4030_usb *twl)
twl               254 drivers/phy/ti/phy-twl4030-usb.c 	ret = twl4030_usb_read(twl, PHY_CLK_CTRL_STS);
twl               262 drivers/phy/ti/phy-twl4030-usb.c 	ret = twl4030_usb_read(twl, ULPI_OTG_CTRL);
twl               270 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_linkstat(struct twl4030_usb *twl)
twl               275 drivers/phy/ti/phy-twl4030-usb.c 	twl->vbus_supplied = false;
twl               287 drivers/phy/ti/phy-twl4030-usb.c 	status = twl4030_readb(twl, TWL_MODULE_PM_MASTER, STS_HW_CONDITIONS);
twl               289 drivers/phy/ti/phy-twl4030-usb.c 		dev_err(twl->dev, "USB link status err %d\n", status);
twl               292 drivers/phy/ti/phy-twl4030-usb.c 			if (twl4030_is_driving_vbus(twl))
twl               295 drivers/phy/ti/phy-twl4030-usb.c 				twl->vbus_supplied = true;
twl               305 drivers/phy/ti/phy-twl4030-usb.c 		if (twl->linkstat != MUSB_UNKNOWN)
twl               309 drivers/phy/ti/phy-twl4030-usb.c 	kobject_uevent(&twl->dev->kobj, linkstat == MUSB_VBUS_VALID
twl               312 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "HW_CONDITIONS 0x%02x/%d; link %d\n",
twl               322 drivers/phy/ti/phy-twl4030-usb.c static void twl4030_usb_set_mode(struct twl4030_usb *twl, int mode)
twl               324 drivers/phy/ti/phy-twl4030-usb.c 	twl->usb_mode = mode;
twl               328 drivers/phy/ti/phy-twl4030-usb.c 		twl4030_usb_clear_bits(twl, ULPI_IFC_CTRL,
twl               330 drivers/phy/ti/phy-twl4030-usb.c 		twl4030_usb_set_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB);
twl               331 drivers/phy/ti/phy-twl4030-usb.c 		twl4030_usb_clear_bits(twl, ULPI_FUNC_CTRL,
twl               339 drivers/phy/ti/phy-twl4030-usb.c 		dev_err(twl->dev, "unsupported T2 transceiver mode %d\n",
twl               345 drivers/phy/ti/phy-twl4030-usb.c static void twl4030_i2c_access(struct twl4030_usb *twl, int on)
twl               348 drivers/phy/ti/phy-twl4030-usb.c 	int val = twl4030_usb_read(twl, PHY_CLK_CTRL);
twl               354 drivers/phy/ti/phy-twl4030-usb.c 			WARN_ON(twl4030_usb_write_verify(twl, PHY_CLK_CTRL,
twl               358 drivers/phy/ti/phy-twl4030-usb.c 			while (!(twl4030_usb_read(twl, PHY_CLK_CTRL_STS) &
twl               362 drivers/phy/ti/phy-twl4030-usb.c 			if (!(twl4030_usb_read(twl, PHY_CLK_CTRL_STS) &
twl               364 drivers/phy/ti/phy-twl4030-usb.c 				dev_err(twl->dev, "Timeout setting T2 HSUSB "
twl               369 drivers/phy/ti/phy-twl4030-usb.c 			WARN_ON(twl4030_usb_write_verify(twl, PHY_CLK_CTRL,
twl               375 drivers/phy/ti/phy-twl4030-usb.c static void __twl4030_phy_power(struct twl4030_usb *twl, int on)
twl               377 drivers/phy/ti/phy-twl4030-usb.c 	u8 pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);
twl               384 drivers/phy/ti/phy-twl4030-usb.c 	WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
twl               389 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = dev_get_drvdata(dev);
twl               396 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "%s\n", __func__);
twl               397 drivers/phy/ti/phy-twl4030-usb.c 	disable_irq(twl->irq);
twl               404 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = dev_get_drvdata(dev);
twl               406 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "%s\n", __func__);
twl               407 drivers/phy/ti/phy-twl4030-usb.c 	enable_irq(twl->irq);
twl               409 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_irq(0, twl);
twl               416 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = dev_get_drvdata(dev);
twl               418 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "%s\n", __func__);
twl               420 drivers/phy/ti/phy-twl4030-usb.c 	__twl4030_phy_power(twl, 0);
twl               421 drivers/phy/ti/phy-twl4030-usb.c 	regulator_disable(twl->usb1v5);
twl               422 drivers/phy/ti/phy-twl4030-usb.c 	regulator_disable(twl->usb1v8);
twl               423 drivers/phy/ti/phy-twl4030-usb.c 	regulator_disable(twl->usb3v1);
twl               430 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = dev_get_drvdata(dev);
twl               433 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "%s\n", __func__);
twl               435 drivers/phy/ti/phy-twl4030-usb.c 	res = regulator_enable(twl->usb3v1);
twl               437 drivers/phy/ti/phy-twl4030-usb.c 		dev_err(twl->dev, "Failed to enable usb3v1\n");
twl               439 drivers/phy/ti/phy-twl4030-usb.c 	res = regulator_enable(twl->usb1v8);
twl               441 drivers/phy/ti/phy-twl4030-usb.c 		dev_err(twl->dev, "Failed to enable usb1v8\n");
twl               452 drivers/phy/ti/phy-twl4030-usb.c 	res = regulator_enable(twl->usb1v5);
twl               454 drivers/phy/ti/phy-twl4030-usb.c 		dev_err(twl->dev, "Failed to enable usb1v5\n");
twl               456 drivers/phy/ti/phy-twl4030-usb.c 	__twl4030_phy_power(twl, 1);
twl               457 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_write(twl, PHY_CLK_CTRL,
twl               458 drivers/phy/ti/phy-twl4030-usb.c 			  twl4030_usb_read(twl, PHY_CLK_CTRL) |
twl               462 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_i2c_access(twl, 1);
twl               463 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_set_mode(twl, twl->usb_mode);
twl               464 drivers/phy/ti/phy-twl4030-usb.c 	if (twl->usb_mode == T2_USB_MODE_ULPI)
twl               465 drivers/phy/ti/phy-twl4030-usb.c 		twl4030_i2c_access(twl, 0);
twl               478 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = phy_get_drvdata(phy);
twl               480 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "%s\n", __func__);
twl               487 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = phy_get_drvdata(phy);
twl               489 drivers/phy/ti/phy-twl4030-usb.c 	dev_dbg(twl->dev, "%s\n", __func__);
twl               490 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_get_sync(twl->dev);
twl               491 drivers/phy/ti/phy-twl4030-usb.c 	schedule_delayed_work(&twl->id_workaround_work, HZ);
twl               492 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_mark_last_busy(twl->dev);
twl               493 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_put_autosuspend(twl->dev);
twl               498 drivers/phy/ti/phy-twl4030-usb.c static int twl4030_usb_ldo_init(struct twl4030_usb *twl)
twl               516 drivers/phy/ti/phy-twl4030-usb.c 	twl->usb3v1 = devm_regulator_get(twl->dev, "usb3v1");
twl               517 drivers/phy/ti/phy-twl4030-usb.c 	if (IS_ERR(twl->usb3v1))
twl               525 drivers/phy/ti/phy-twl4030-usb.c 	twl->usb1v5 = devm_regulator_get(twl->dev, "usb1v5");
twl               526 drivers/phy/ti/phy-twl4030-usb.c 	if (IS_ERR(twl->usb1v5))
twl               534 drivers/phy/ti/phy-twl4030-usb.c 	twl->usb1v8 = devm_regulator_get(twl->dev, "usb1v8");
twl               535 drivers/phy/ti/phy-twl4030-usb.c 	if (IS_ERR(twl->usb1v8))
twl               550 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = dev_get_drvdata(dev);
twl               553 drivers/phy/ti/phy-twl4030-usb.c 	mutex_lock(&twl->lock);
twl               555 drivers/phy/ti/phy-twl4030-usb.c 			twl->vbus_supplied ? "on" : "off");
twl               556 drivers/phy/ti/phy-twl4030-usb.c 	mutex_unlock(&twl->lock);
twl               564 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = _twl;
twl               568 drivers/phy/ti/phy-twl4030-usb.c 	status = twl4030_usb_linkstat(twl);
twl               570 drivers/phy/ti/phy-twl4030-usb.c 	mutex_lock(&twl->lock);
twl               571 drivers/phy/ti/phy-twl4030-usb.c 	twl->linkstat = status;
twl               572 drivers/phy/ti/phy-twl4030-usb.c 	mutex_unlock(&twl->lock);
twl               575 drivers/phy/ti/phy-twl4030-usb.c 		if (atomic_add_unless(&twl->connected, 1, 1)) {
twl               576 drivers/phy/ti/phy-twl4030-usb.c 			dev_dbg(twl->dev, "%s: cable connected %i\n",
twl               578 drivers/phy/ti/phy-twl4030-usb.c 			pm_runtime_get_sync(twl->dev);
twl               579 drivers/phy/ti/phy-twl4030-usb.c 			twl->musb_mailbox_pending = true;
twl               582 drivers/phy/ti/phy-twl4030-usb.c 		if (atomic_add_unless(&twl->connected, -1, 0)) {
twl               583 drivers/phy/ti/phy-twl4030-usb.c 			dev_dbg(twl->dev, "%s: cable disconnected %i\n",
twl               585 drivers/phy/ti/phy-twl4030-usb.c 			pm_runtime_mark_last_busy(twl->dev);
twl               586 drivers/phy/ti/phy-twl4030-usb.c 			pm_runtime_put_autosuspend(twl->dev);
twl               587 drivers/phy/ti/phy-twl4030-usb.c 			twl->musb_mailbox_pending = true;
twl               590 drivers/phy/ti/phy-twl4030-usb.c 	if (twl->musb_mailbox_pending) {
twl               593 drivers/phy/ti/phy-twl4030-usb.c 			twl->musb_mailbox_pending = false;
twl               597 drivers/phy/ti/phy-twl4030-usb.c 	if (status == MUSB_ID_GROUND && pm_runtime_active(twl->dev)) {
twl               598 drivers/phy/ti/phy-twl4030-usb.c 		cancel_delayed_work(&twl->id_workaround_work);
twl               599 drivers/phy/ti/phy-twl4030-usb.c 		schedule_delayed_work(&twl->id_workaround_work, HZ);
twl               603 drivers/phy/ti/phy-twl4030-usb.c 		sysfs_notify(&twl->dev->kobj, NULL, "vbus");
twl               610 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = container_of(work, struct twl4030_usb,
twl               613 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_irq(0, twl);
twl               618 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = phy_get_drvdata(phy);
twl               620 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_get_sync(twl->dev);
twl               621 drivers/phy/ti/phy-twl4030-usb.c 	twl->linkstat = MUSB_UNKNOWN;
twl               622 drivers/phy/ti/phy-twl4030-usb.c 	schedule_delayed_work(&twl->id_workaround_work, HZ);
twl               623 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_mark_last_busy(twl->dev);
twl               624 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_put_autosuspend(twl->dev);
twl               670 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb	*twl;
twl               677 drivers/phy/ti/phy-twl4030-usb.c 	twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
twl               678 drivers/phy/ti/phy-twl4030-usb.c 	if (!twl)
twl               683 drivers/phy/ti/phy-twl4030-usb.c 				(enum twl4030_usb_mode *)&twl->usb_mode);
twl               685 drivers/phy/ti/phy-twl4030-usb.c 		twl->usb_mode = pdata->usb_mode;
twl               695 drivers/phy/ti/phy-twl4030-usb.c 	twl->dev		= &pdev->dev;
twl               696 drivers/phy/ti/phy-twl4030-usb.c 	twl->irq		= platform_get_irq(pdev, 0);
twl               697 drivers/phy/ti/phy-twl4030-usb.c 	twl->vbus_supplied	= false;
twl               698 drivers/phy/ti/phy-twl4030-usb.c 	twl->linkstat		= MUSB_UNKNOWN;
twl               699 drivers/phy/ti/phy-twl4030-usb.c 	twl->musb_mailbox_pending = false;
twl               701 drivers/phy/ti/phy-twl4030-usb.c 	twl->phy.dev		= twl->dev;
twl               702 drivers/phy/ti/phy-twl4030-usb.c 	twl->phy.label		= "twl4030";
twl               703 drivers/phy/ti/phy-twl4030-usb.c 	twl->phy.otg		= otg;
twl               704 drivers/phy/ti/phy-twl4030-usb.c 	twl->phy.type		= USB_PHY_TYPE_USB2;
twl               706 drivers/phy/ti/phy-twl4030-usb.c 	otg->usb_phy		= &twl->phy;
twl               710 drivers/phy/ti/phy-twl4030-usb.c 	phy = devm_phy_create(twl->dev, NULL, &ops);
twl               716 drivers/phy/ti/phy-twl4030-usb.c 	phy_set_drvdata(phy, twl);
twl               718 drivers/phy/ti/phy-twl4030-usb.c 	phy_provider = devm_of_phy_provider_register(twl->dev,
twl               724 drivers/phy/ti/phy-twl4030-usb.c 	mutex_init(&twl->lock);
twl               726 drivers/phy/ti/phy-twl4030-usb.c 	INIT_DELAYED_WORK(&twl->id_workaround_work, twl4030_id_workaround_work);
twl               728 drivers/phy/ti/phy-twl4030-usb.c 	err = twl4030_usb_ldo_init(twl);
twl               733 drivers/phy/ti/phy-twl4030-usb.c 	usb_add_phy_dev(&twl->phy);
twl               735 drivers/phy/ti/phy-twl4030-usb.c 	platform_set_drvdata(pdev, twl);
twl               739 drivers/phy/ti/phy-twl4030-usb.c 	ATOMIC_INIT_NOTIFIER_HEAD(&twl->phy.notifier);
twl               754 drivers/phy/ti/phy-twl4030-usb.c 	status = devm_request_threaded_irq(twl->dev, twl->irq, NULL,
twl               756 drivers/phy/ti/phy-twl4030-usb.c 			IRQF_TRIGGER_RISING | IRQF_ONESHOT, "twl4030_usb", twl);
twl               759 drivers/phy/ti/phy-twl4030-usb.c 			twl->irq, status);
twl               769 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_put_autosuspend(twl->dev);
twl               777 drivers/phy/ti/phy-twl4030-usb.c 	struct twl4030_usb *twl = platform_get_drvdata(pdev);
twl               780 drivers/phy/ti/phy-twl4030-usb.c 	usb_remove_phy(&twl->phy);
twl               781 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_get_sync(twl->dev);
twl               782 drivers/phy/ti/phy-twl4030-usb.c 	cancel_delayed_work(&twl->id_workaround_work);
twl               783 drivers/phy/ti/phy-twl4030-usb.c 	device_remove_file(twl->dev, &dev_attr_vbus);
twl               786 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_set_mode(twl, -1);
twl               789 drivers/phy/ti/phy-twl4030-usb.c 	if (cable_present(twl->linkstat))
twl               790 drivers/phy/ti/phy-twl4030-usb.c 		pm_runtime_put_noidle(twl->dev);
twl               791 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_mark_last_busy(twl->dev);
twl               793 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_put_sync(twl->dev);
twl               794 drivers/phy/ti/phy-twl4030-usb.c 	pm_runtime_disable(twl->dev);
twl               800 drivers/phy/ti/phy-twl4030-usb.c 	val = twl4030_usb_read(twl, PHY_CLK_CTRL);
twl               804 drivers/phy/ti/phy-twl4030-usb.c 		twl4030_usb_write(twl, PHY_CLK_CTRL, (u8)val);
twl               808 drivers/phy/ti/phy-twl4030-usb.c 	twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB);
twl                94 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = to_twl(chip);
twl                98 drivers/pwm/pwm-twl-led.c 	mutex_lock(&twl->mutex);
twl               112 drivers/pwm/pwm-twl-led.c 	mutex_unlock(&twl->mutex);
twl               119 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = to_twl(chip);
twl               123 drivers/pwm/pwm-twl-led.c 	mutex_lock(&twl->mutex);
twl               137 drivers/pwm/pwm-twl-led.c 	mutex_unlock(&twl->mutex);
twl               159 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = to_twl(chip);
twl               163 drivers/pwm/pwm-twl-led.c 	mutex_lock(&twl->mutex);
twl               179 drivers/pwm/pwm-twl-led.c 	mutex_unlock(&twl->mutex);
twl               186 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = to_twl(chip);
twl               190 drivers/pwm/pwm-twl-led.c 	mutex_lock(&twl->mutex);
twl               206 drivers/pwm/pwm-twl-led.c 	mutex_unlock(&twl->mutex);
twl               211 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = to_twl(chip);
twl               215 drivers/pwm/pwm-twl-led.c 	mutex_lock(&twl->mutex);
twl               231 drivers/pwm/pwm-twl-led.c 	mutex_unlock(&twl->mutex);
twl               237 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = to_twl(chip);
twl               241 drivers/pwm/pwm-twl-led.c 	mutex_lock(&twl->mutex);
twl               257 drivers/pwm/pwm-twl-led.c 	mutex_unlock(&twl->mutex);
twl               278 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl;
twl               281 drivers/pwm/pwm-twl-led.c 	twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
twl               282 drivers/pwm/pwm-twl-led.c 	if (!twl)
twl               286 drivers/pwm/pwm-twl-led.c 		twl->chip.ops = &twl4030_pwmled_ops;
twl               287 drivers/pwm/pwm-twl-led.c 		twl->chip.npwm = 2;
twl               289 drivers/pwm/pwm-twl-led.c 		twl->chip.ops = &twl6030_pwmled_ops;
twl               290 drivers/pwm/pwm-twl-led.c 		twl->chip.npwm = 1;
twl               293 drivers/pwm/pwm-twl-led.c 	twl->chip.dev = &pdev->dev;
twl               294 drivers/pwm/pwm-twl-led.c 	twl->chip.base = -1;
twl               296 drivers/pwm/pwm-twl-led.c 	mutex_init(&twl->mutex);
twl               298 drivers/pwm/pwm-twl-led.c 	ret = pwmchip_add(&twl->chip);
twl               302 drivers/pwm/pwm-twl-led.c 	platform_set_drvdata(pdev, twl);
twl               309 drivers/pwm/pwm-twl-led.c 	struct twl_pwmled_chip *twl = platform_get_drvdata(pdev);
twl               311 drivers/pwm/pwm-twl-led.c 	return pwmchip_remove(&twl->chip);
twl                96 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = to_twl(chip);
twl               100 drivers/pwm/pwm-twl.c 	mutex_lock(&twl->mutex);
twl               120 drivers/pwm/pwm-twl.c 	mutex_unlock(&twl->mutex);
twl               126 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = to_twl(chip);
twl               130 drivers/pwm/pwm-twl.c 	mutex_lock(&twl->mutex);
twl               150 drivers/pwm/pwm-twl.c 	mutex_unlock(&twl->mutex);
twl               155 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = to_twl(chip);
twl               167 drivers/pwm/pwm-twl.c 	mutex_lock(&twl->mutex);
twl               175 drivers/pwm/pwm-twl.c 	twl->twl4030_pwm_mux &= ~mask;
twl               176 drivers/pwm/pwm-twl.c 	twl->twl4030_pwm_mux |= (val & mask);
twl               187 drivers/pwm/pwm-twl.c 	mutex_unlock(&twl->mutex);
twl               193 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = to_twl(chip);
twl               202 drivers/pwm/pwm-twl.c 	mutex_lock(&twl->mutex);
twl               211 drivers/pwm/pwm-twl.c 	val |= (twl->twl4030_pwm_mux & mask);
twl               218 drivers/pwm/pwm-twl.c 	mutex_unlock(&twl->mutex);
twl               223 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = to_twl(chip);
twl               227 drivers/pwm/pwm-twl.c 	mutex_lock(&twl->mutex);
twl               228 drivers/pwm/pwm-twl.c 	val = twl->twl6030_toggle3;
twl               238 drivers/pwm/pwm-twl.c 	twl->twl6030_toggle3 = val;
twl               240 drivers/pwm/pwm-twl.c 	mutex_unlock(&twl->mutex);
twl               246 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = to_twl(chip);
twl               250 drivers/pwm/pwm-twl.c 	mutex_lock(&twl->mutex);
twl               251 drivers/pwm/pwm-twl.c 	val = twl->twl6030_toggle3;
twl               277 drivers/pwm/pwm-twl.c 	twl->twl6030_toggle3 = val;
twl               279 drivers/pwm/pwm-twl.c 	mutex_unlock(&twl->mutex);
twl               300 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl;
twl               303 drivers/pwm/pwm-twl.c 	twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
twl               304 drivers/pwm/pwm-twl.c 	if (!twl)
twl               308 drivers/pwm/pwm-twl.c 		twl->chip.ops = &twl4030_pwm_ops;
twl               310 drivers/pwm/pwm-twl.c 		twl->chip.ops = &twl6030_pwm_ops;
twl               312 drivers/pwm/pwm-twl.c 	twl->chip.dev = &pdev->dev;
twl               313 drivers/pwm/pwm-twl.c 	twl->chip.base = -1;
twl               314 drivers/pwm/pwm-twl.c 	twl->chip.npwm = 2;
twl               316 drivers/pwm/pwm-twl.c 	mutex_init(&twl->mutex);
twl               318 drivers/pwm/pwm-twl.c 	ret = pwmchip_add(&twl->chip);
twl               322 drivers/pwm/pwm-twl.c 	platform_set_drvdata(pdev, twl);
twl               329 drivers/pwm/pwm-twl.c 	struct twl_pwm_chip *twl = platform_get_drvdata(pdev);
twl               331 drivers/pwm/pwm-twl.c 	return pwmchip_remove(&twl->chip);
twl               104 drivers/usb/phy/phy-twl6030-usb.c static inline int twl6030_writeb(struct twl6030_usb *twl, u8 module,
twl               111 drivers/usb/phy/phy-twl6030-usb.c 		dev_err(twl->dev,
twl               116 drivers/usb/phy/phy-twl6030-usb.c static inline u8 twl6030_readb(struct twl6030_usb *twl, u8 module, u8 address)
twl               125 drivers/usb/phy/phy-twl6030-usb.c 		dev_err(twl->dev,
twl               133 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = comparator_to_twl(comparator);
twl               135 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, 0x24, USB_VBUS_CTRL_SET);
twl               136 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, 0x84, USB_VBUS_CTRL_SET);
twl               139 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, 0xa0, USB_VBUS_CTRL_CLR);
twl               144 drivers/usb/phy/phy-twl6030-usb.c static int twl6030_usb_ldo_init(struct twl6030_usb *twl)
twl               147 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL6030_MODULE_ID0, 0x1, TWL6030_BACKUP_REG);
twl               150 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL6030_MODULE_ID0, 0x1, TWL6030_CFG_LDO_PD2);
twl               153 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL6030_MODULE_ID0, 0x10, TWL6030_MISC2);
twl               155 drivers/usb/phy/phy-twl6030-usb.c 	twl->usb3v3 = regulator_get(twl->dev, "usb");
twl               156 drivers/usb/phy/phy-twl6030-usb.c 	if (IS_ERR(twl->usb3v3))
twl               160 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, 0x4, USB_VBUS_CTRL_SET);
twl               166 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, 0x14, USB_ID_CTRL_SET);
twl               174 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = dev_get_drvdata(dev);
twl               178 drivers/usb/phy/phy-twl6030-usb.c 	spin_lock_irqsave(&twl->lock, flags);
twl               180 drivers/usb/phy/phy-twl6030-usb.c 	switch (twl->linkstat) {
twl               193 drivers/usb/phy/phy-twl6030-usb.c 	spin_unlock_irqrestore(&twl->lock, flags);
twl               207 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = _twl;
twl               212 drivers/usb/phy/phy-twl6030-usb.c 	hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS);
twl               214 drivers/usb/phy/phy-twl6030-usb.c 	vbus_state = twl6030_readb(twl, TWL_MODULE_MAIN_CHARGE,
twl               218 drivers/usb/phy/phy-twl6030-usb.c 			ret = regulator_enable(twl->usb3v3);
twl               220 drivers/usb/phy/phy-twl6030-usb.c 				dev_err(twl->dev, "Failed to enable usb3v3\n");
twl               222 drivers/usb/phy/phy-twl6030-usb.c 			twl->asleep = 1;
twl               224 drivers/usb/phy/phy-twl6030-usb.c 			twl->linkstat = status;
twl               227 drivers/usb/phy/phy-twl6030-usb.c 				twl->linkstat = MUSB_UNKNOWN;
twl               229 drivers/usb/phy/phy-twl6030-usb.c 			if (twl->linkstat != MUSB_UNKNOWN) {
twl               231 drivers/usb/phy/phy-twl6030-usb.c 				twl->linkstat = status;
twl               234 drivers/usb/phy/phy-twl6030-usb.c 					twl->linkstat = MUSB_UNKNOWN;
twl               235 drivers/usb/phy/phy-twl6030-usb.c 				if (twl->asleep) {
twl               236 drivers/usb/phy/phy-twl6030-usb.c 					regulator_disable(twl->usb3v3);
twl               237 drivers/usb/phy/phy-twl6030-usb.c 					twl->asleep = 0;
twl               242 drivers/usb/phy/phy-twl6030-usb.c 	sysfs_notify(&twl->dev->kobj, NULL, "vbus");
twl               249 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = _twl;
twl               254 drivers/usb/phy/phy-twl6030-usb.c 	hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS);
twl               257 drivers/usb/phy/phy-twl6030-usb.c 		ret = regulator_enable(twl->usb3v3);
twl               259 drivers/usb/phy/phy-twl6030-usb.c 			dev_err(twl->dev, "Failed to enable usb3v3\n");
twl               261 drivers/usb/phy/phy-twl6030-usb.c 		twl->asleep = 1;
twl               262 drivers/usb/phy/phy-twl6030-usb.c 		twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_CLR);
twl               263 drivers/usb/phy/phy-twl6030-usb.c 		twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_SET);
twl               265 drivers/usb/phy/phy-twl6030-usb.c 		twl->linkstat = status;
twl               268 drivers/usb/phy/phy-twl6030-usb.c 			twl->linkstat = MUSB_UNKNOWN;
twl               270 drivers/usb/phy/phy-twl6030-usb.c 		twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_CLR);
twl               271 drivers/usb/phy/phy-twl6030-usb.c 		twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET);
twl               273 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, status, USB_ID_INT_LATCH_CLR);
twl               280 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = container_of(work, struct twl6030_usb,
twl               283 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_usb_irq(twl->irq2, twl);
twl               284 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_usbotg_irq(twl->irq1, twl);
twl               287 drivers/usb/phy/phy-twl6030-usb.c static int twl6030_enable_irq(struct twl6030_usb *twl)
twl               289 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET);
twl               303 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = container_of(data, struct twl6030_usb,
twl               311 drivers/usb/phy/phy-twl6030-usb.c 	if (twl->vbus_enable)
twl               312 drivers/usb/phy/phy-twl6030-usb.c 		twl6030_writeb(twl, TWL_MODULE_MAIN_CHARGE, 0x40,
twl               315 drivers/usb/phy/phy-twl6030-usb.c 		twl6030_writeb(twl, TWL_MODULE_MAIN_CHARGE, 0x00,
twl               321 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = comparator_to_twl(comparator);
twl               323 drivers/usb/phy/phy-twl6030-usb.c 	twl->vbus_enable = enabled;
twl               324 drivers/usb/phy/phy-twl6030-usb.c 	schedule_work(&twl->set_vbus_work);
twl               332 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb	*twl;
twl               342 drivers/usb/phy/phy-twl6030-usb.c 	twl = devm_kzalloc(dev, sizeof(*twl), GFP_KERNEL);
twl               343 drivers/usb/phy/phy-twl6030-usb.c 	if (!twl)
twl               346 drivers/usb/phy/phy-twl6030-usb.c 	twl->dev		= &pdev->dev;
twl               347 drivers/usb/phy/phy-twl6030-usb.c 	twl->irq1		= platform_get_irq(pdev, 0);
twl               348 drivers/usb/phy/phy-twl6030-usb.c 	twl->irq2		= platform_get_irq(pdev, 1);
twl               349 drivers/usb/phy/phy-twl6030-usb.c 	twl->linkstat		= MUSB_UNKNOWN;
twl               351 drivers/usb/phy/phy-twl6030-usb.c 	twl->comparator.set_vbus	= twl6030_set_vbus;
twl               352 drivers/usb/phy/phy-twl6030-usb.c 	twl->comparator.start_srp	= twl6030_start_srp;
twl               354 drivers/usb/phy/phy-twl6030-usb.c 	ret = omap_usb2_set_comparator(&twl->comparator);
twl               361 drivers/usb/phy/phy-twl6030-usb.c 	spin_lock_init(&twl->lock);
twl               363 drivers/usb/phy/phy-twl6030-usb.c 	err = twl6030_usb_ldo_init(twl);
twl               369 drivers/usb/phy/phy-twl6030-usb.c 	platform_set_drvdata(pdev, twl);
twl               371 drivers/usb/phy/phy-twl6030-usb.c 	INIT_WORK(&twl->set_vbus_work, otg_set_vbus_work);
twl               372 drivers/usb/phy/phy-twl6030-usb.c 	INIT_DELAYED_WORK(&twl->get_status_work, twl6030_status_work);
twl               374 drivers/usb/phy/phy-twl6030-usb.c 	status = request_threaded_irq(twl->irq1, NULL, twl6030_usbotg_irq,
twl               376 drivers/usb/phy/phy-twl6030-usb.c 			"twl6030_usb", twl);
twl               379 drivers/usb/phy/phy-twl6030-usb.c 			twl->irq1, status);
twl               383 drivers/usb/phy/phy-twl6030-usb.c 	status = request_threaded_irq(twl->irq2, NULL, twl6030_usb_irq,
twl               385 drivers/usb/phy/phy-twl6030-usb.c 			"twl6030_usb", twl);
twl               388 drivers/usb/phy/phy-twl6030-usb.c 			twl->irq2, status);
twl               392 drivers/usb/phy/phy-twl6030-usb.c 	twl->asleep = 0;
twl               393 drivers/usb/phy/phy-twl6030-usb.c 	twl6030_enable_irq(twl);
twl               394 drivers/usb/phy/phy-twl6030-usb.c 	schedule_delayed_work(&twl->get_status_work, HZ);
twl               400 drivers/usb/phy/phy-twl6030-usb.c 	free_irq(twl->irq1, twl);
twl               402 drivers/usb/phy/phy-twl6030-usb.c 	regulator_put(twl->usb3v3);
twl               409 drivers/usb/phy/phy-twl6030-usb.c 	struct twl6030_usb *twl = platform_get_drvdata(pdev);
twl               411 drivers/usb/phy/phy-twl6030-usb.c 	cancel_delayed_work_sync(&twl->get_status_work);
twl               416 drivers/usb/phy/phy-twl6030-usb.c 	free_irq(twl->irq1, twl);
twl               417 drivers/usb/phy/phy-twl6030-usb.c 	free_irq(twl->irq2, twl);
twl               418 drivers/usb/phy/phy-twl6030-usb.c 	regulator_put(twl->usb3v3);
twl               419 drivers/usb/phy/phy-twl6030-usb.c 	cancel_work_sync(&twl->set_vbus_work);