tc3589x            29 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x;
tc3589x            40 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x            45 drivers/gpio/gpio-tc3589x.c 	ret = tc3589x_reg_read(tc3589x, reg);
tc3589x            55 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x            60 drivers/gpio/gpio-tc3589x.c 	tc3589x_block_write(tc3589x, reg, ARRAY_SIZE(data), data);
tc3589x            67 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x            73 drivers/gpio/gpio-tc3589x.c 	return tc3589x_set_bits(tc3589x, reg, BIT(pos), BIT(pos));
tc3589x            80 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x            84 drivers/gpio/gpio-tc3589x.c 	return tc3589x_set_bits(tc3589x, reg, BIT(pos), 0);
tc3589x            91 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x            96 drivers/gpio/gpio-tc3589x.c 	ret = tc3589x_reg_read(tc3589x, reg);
tc3589x           107 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x           121 drivers/gpio/gpio-tc3589x.c 		ret = tc3589x_set_bits(tc3589x, odmreg, BIT(pos), 0);
tc3589x           125 drivers/gpio/gpio-tc3589x.c 		return tc3589x_set_bits(tc3589x, odereg, BIT(pos), BIT(pos));
tc3589x           128 drivers/gpio/gpio-tc3589x.c 		ret = tc3589x_set_bits(tc3589x, odmreg, BIT(pos), BIT(pos));
tc3589x           132 drivers/gpio/gpio-tc3589x.c 		return tc3589x_set_bits(tc3589x, odereg, BIT(pos), BIT(pos));
tc3589x           135 drivers/gpio/gpio-tc3589x.c 		return tc3589x_set_bits(tc3589x, odereg, BIT(pos), 0);
tc3589x           194 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x           212 drivers/gpio/gpio-tc3589x.c 			tc3589x_reg_write(tc3589x, regmap[i] + j * 8, new);
tc3589x           253 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = tc3589x_gpio->tc3589x;
tc3589x           258 drivers/gpio/gpio-tc3589x.c 	ret = tc3589x_block_read(tc3589x, TC3589x_GPIOMIS0,
tc3589x           278 drivers/gpio/gpio-tc3589x.c 		tc3589x_reg_write(tc3589x, TC3589x_GPIOIC0 + i, status[i]);
tc3589x           286 drivers/gpio/gpio-tc3589x.c 	struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
tc3589x           309 drivers/gpio/gpio-tc3589x.c 	tc3589x_gpio->tc3589x = tc3589x;
tc3589x           312 drivers/gpio/gpio-tc3589x.c 	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
tc3589x           318 drivers/gpio/gpio-tc3589x.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL,
tc3589x           105 drivers/input/keyboard/tc3589x-keypad.c 	struct tc3589x *tc3589x;
tc3589x           117 drivers/input/keyboard/tc3589x-keypad.c 	struct tc3589x *tc3589x = keypad->tc3589x;
tc3589x           125 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_KBDSIZE,
tc3589x           131 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_KBCFG_LSB, DEDICATED_KEY_VAL);
tc3589x           135 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_KBCFG_MSB, DEDICATED_KEY_VAL);
tc3589x           140 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_KBDSETTLE_REG,
tc3589x           146 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_KBDBOUNCE,
tc3589x           152 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_IOCFG, 0x0, IOCFG_IG);
tc3589x           157 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG0_LSB,
tc3589x           162 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG0_MSB,
tc3589x           168 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG1_LSB,
tc3589x           173 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG1_MSB,
tc3589x           178 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG2_LSB,
tc3589x           192 drivers/input/keyboard/tc3589x-keypad.c 	struct tc3589x *tc3589x = keypad->tc3589x;
tc3589x           197 drivers/input/keyboard/tc3589x-keypad.c 		kbd_code = tc3589x_reg_read(tc3589x, TC3589x_EVTCODE_FIFO);
tc3589x           217 drivers/input/keyboard/tc3589x-keypad.c 	tc3589x_set_bits(tc3589x, TC3589x_KBDIC,
tc3589x           220 drivers/input/keyboard/tc3589x-keypad.c 	tc3589x_set_bits(tc3589x, TC3589x_KBDMSK,
tc3589x           228 drivers/input/keyboard/tc3589x-keypad.c 	struct tc3589x *tc3589x = keypad->tc3589x;
tc3589x           232 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL, TC3589x_KBDRST, 0x0);
tc3589x           237 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_KBDMFS, 0x0, TC3589x_KBDMFS_EN);
tc3589x           242 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_CLKEN, 0x0, KPD_CLK_EN);
tc3589x           247 drivers/input/keyboard/tc3589x-keypad.c 	ret =  tc3589x_set_bits(tc3589x, TC3589x_RSTINTCLR, 0x0, 0x1);
tc3589x           252 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_KBDMSK, 0x0,
tc3589x           264 drivers/input/keyboard/tc3589x-keypad.c 	struct tc3589x *tc3589x = keypad->tc3589x;
tc3589x           268 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_KBDIC,
tc3589x           274 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_KBDMSK,
tc3589x           280 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_CLKEN, 0x1, 0x0);
tc3589x           285 drivers/input/keyboard/tc3589x-keypad.c 	ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL, TC3589x_KBDRST, 0x1);
tc3589x           376 drivers/input/keyboard/tc3589x-keypad.c 	struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
tc3589x           405 drivers/input/keyboard/tc3589x-keypad.c 	keypad->tc3589x = tc3589x;
tc3589x            42 drivers/mfd/tc3589x.c int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg)
tc3589x            46 drivers/mfd/tc3589x.c 	ret = i2c_smbus_read_byte_data(tc3589x->i2c, reg);
tc3589x            48 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "failed to read reg %#x: %d\n",
tc3589x            61 drivers/mfd/tc3589x.c int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data)
tc3589x            65 drivers/mfd/tc3589x.c 	ret = i2c_smbus_write_byte_data(tc3589x->i2c, reg, data);
tc3589x            67 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "failed to write reg %#x: %d\n",
tc3589x            81 drivers/mfd/tc3589x.c int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length, u8 *values)
tc3589x            85 drivers/mfd/tc3589x.c 	ret = i2c_smbus_read_i2c_block_data(tc3589x->i2c, reg, length, values);
tc3589x            87 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "failed to read regs %#x: %d\n",
tc3589x           101 drivers/mfd/tc3589x.c int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length,
tc3589x           106 drivers/mfd/tc3589x.c 	ret = i2c_smbus_write_i2c_block_data(tc3589x->i2c, reg, length,
tc3589x           109 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "failed to write regs %#x: %d\n",
tc3589x           123 drivers/mfd/tc3589x.c int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val)
tc3589x           127 drivers/mfd/tc3589x.c 	mutex_lock(&tc3589x->lock);
tc3589x           129 drivers/mfd/tc3589x.c 	ret = tc3589x_reg_read(tc3589x, reg);
tc3589x           136 drivers/mfd/tc3589x.c 	ret = tc3589x_reg_write(tc3589x, reg, ret);
tc3589x           139 drivers/mfd/tc3589x.c 	mutex_unlock(&tc3589x->lock);
tc3589x           180 drivers/mfd/tc3589x.c 	struct tc3589x *tc3589x = data;
tc3589x           184 drivers/mfd/tc3589x.c 	status = tc3589x_reg_read(tc3589x, TC3589x_IRQST);
tc3589x           190 drivers/mfd/tc3589x.c 		int virq = irq_create_mapping(tc3589x->domain, bit);
tc3589x           202 drivers/mfd/tc3589x.c 	status = tc3589x_reg_read(tc3589x, TC3589x_IRQST);
tc3589x           212 drivers/mfd/tc3589x.c 	struct tc3589x *tc3589x = d->host_data;
tc3589x           214 drivers/mfd/tc3589x.c 	irq_set_chip_data(virq, tc3589x);
tc3589x           235 drivers/mfd/tc3589x.c static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
tc3589x           237 drivers/mfd/tc3589x.c 	tc3589x->domain = irq_domain_add_simple(
tc3589x           239 drivers/mfd/tc3589x.c 		&tc3589x_irq_ops, tc3589x);
tc3589x           241 drivers/mfd/tc3589x.c 	if (!tc3589x->domain) {
tc3589x           242 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "Failed to create irqdomain\n");
tc3589x           249 drivers/mfd/tc3589x.c static int tc3589x_chip_init(struct tc3589x *tc3589x)
tc3589x           253 drivers/mfd/tc3589x.c 	manf = tc3589x_reg_read(tc3589x, TC3589x_MANFCODE);
tc3589x           257 drivers/mfd/tc3589x.c 	ver = tc3589x_reg_read(tc3589x, TC3589x_VERSION);
tc3589x           262 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "unknown manufacturer: %#x\n", manf);
tc3589x           266 drivers/mfd/tc3589x.c 	dev_info(tc3589x->dev, "manufacturer: %#x, version: %#x\n", manf, ver);
tc3589x           273 drivers/mfd/tc3589x.c 	ret = tc3589x_reg_write(tc3589x, TC3589x_RSTCTRL,
tc3589x           281 drivers/mfd/tc3589x.c 	return tc3589x_reg_write(tc3589x, TC3589x_RSTINTCLR, 0x1);
tc3589x           284 drivers/mfd/tc3589x.c static int tc3589x_device_init(struct tc3589x *tc3589x)
tc3589x           287 drivers/mfd/tc3589x.c 	unsigned int blocks = tc3589x->pdata->block;
tc3589x           290 drivers/mfd/tc3589x.c 		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio,
tc3589x           292 drivers/mfd/tc3589x.c 				      0, tc3589x->domain);
tc3589x           294 drivers/mfd/tc3589x.c 			dev_err(tc3589x->dev, "failed to add gpio child\n");
tc3589x           297 drivers/mfd/tc3589x.c 		dev_info(tc3589x->dev, "added gpio block\n");
tc3589x           301 drivers/mfd/tc3589x.c 		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad,
tc3589x           303 drivers/mfd/tc3589x.c 				      0, tc3589x->domain);
tc3589x           305 drivers/mfd/tc3589x.c 			dev_err(tc3589x->dev, "failed to keypad child\n");
tc3589x           308 drivers/mfd/tc3589x.c 		dev_info(tc3589x->dev, "added keypad block\n");
tc3589x           360 drivers/mfd/tc3589x.c 	struct tc3589x *tc3589x;
tc3589x           379 drivers/mfd/tc3589x.c 	tc3589x = devm_kzalloc(&i2c->dev, sizeof(struct tc3589x),
tc3589x           381 drivers/mfd/tc3589x.c 	if (!tc3589x)
tc3589x           384 drivers/mfd/tc3589x.c 	mutex_init(&tc3589x->lock);
tc3589x           386 drivers/mfd/tc3589x.c 	tc3589x->dev = &i2c->dev;
tc3589x           387 drivers/mfd/tc3589x.c 	tc3589x->i2c = i2c;
tc3589x           388 drivers/mfd/tc3589x.c 	tc3589x->pdata = pdata;
tc3589x           394 drivers/mfd/tc3589x.c 		tc3589x->num_gpio = 20;
tc3589x           401 drivers/mfd/tc3589x.c 		tc3589x->num_gpio = 24;
tc3589x           405 drivers/mfd/tc3589x.c 	i2c_set_clientdata(i2c, tc3589x);
tc3589x           407 drivers/mfd/tc3589x.c 	ret = tc3589x_chip_init(tc3589x);
tc3589x           411 drivers/mfd/tc3589x.c 	ret = tc3589x_irq_init(tc3589x, np);
tc3589x           415 drivers/mfd/tc3589x.c 	ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
tc3589x           417 drivers/mfd/tc3589x.c 				   "tc3589x", tc3589x);
tc3589x           419 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret);
tc3589x           423 drivers/mfd/tc3589x.c 	ret = tc3589x_device_init(tc3589x);
tc3589x           425 drivers/mfd/tc3589x.c 		dev_err(tc3589x->dev, "failed to add child devices\n");
tc3589x           434 drivers/mfd/tc3589x.c 	struct tc3589x *tc3589x = i2c_get_clientdata(client);
tc3589x           436 drivers/mfd/tc3589x.c 	mfd_remove_devices(tc3589x->dev);
tc3589x           444 drivers/mfd/tc3589x.c 	struct tc3589x *tc3589x = dev_get_drvdata(dev);
tc3589x           445 drivers/mfd/tc3589x.c 	struct i2c_client *client = tc3589x->i2c;
tc3589x           450 drivers/mfd/tc3589x.c 		ret = tc3589x_reg_write(tc3589x, TC3589x_CLKMODE,
tc3589x           458 drivers/mfd/tc3589x.c 	struct tc3589x *tc3589x = dev_get_drvdata(dev);
tc3589x           459 drivers/mfd/tc3589x.c 	struct i2c_client *client = tc3589x->i2c;
tc3589x           464 drivers/mfd/tc3589x.c 		ret = tc3589x_reg_write(tc3589x, TC3589x_CLKMODE,
tc3589x           125 include/linux/mfd/tc3589x.h extern int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data);
tc3589x           126 include/linux/mfd/tc3589x.h extern int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg);
tc3589x           127 include/linux/mfd/tc3589x.h extern int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length,
tc3589x           129 include/linux/mfd/tc3589x.h extern int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length,
tc3589x           131 include/linux/mfd/tc3589x.h extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val);