• Home
  • Raw
  • Download

Lines Matching refs:stmpe

32 	struct stmpe *stmpe;  member
44 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_get() local
45 u8 reg = stmpe->regs[STMPE_IDX_GPMR_LSB + (offset / 8)]; in stmpe_gpio_get()
49 ret = stmpe_reg_read(stmpe, reg); in stmpe_gpio_get()
59 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_set() local
61 u8 reg = stmpe->regs[which + (offset / 8)]; in stmpe_gpio_set()
68 if (stmpe->regs[STMPE_IDX_GPSR_LSB] == stmpe->regs[STMPE_IDX_GPCR_LSB]) in stmpe_gpio_set()
69 stmpe_set_bits(stmpe, reg, mask, val ? mask : 0); in stmpe_gpio_set()
71 stmpe_reg_write(stmpe, reg, mask); in stmpe_gpio_set()
78 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_get_direction() local
79 u8 reg = stmpe->regs[STMPE_IDX_GPDR_LSB] - (offset / 8); in stmpe_gpio_get_direction()
83 ret = stmpe_reg_read(stmpe, reg); in stmpe_gpio_get_direction()
97 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_direction_output() local
98 u8 reg = stmpe->regs[STMPE_IDX_GPDR_LSB + (offset / 8)]; in stmpe_gpio_direction_output()
103 return stmpe_set_bits(stmpe, reg, mask, mask); in stmpe_gpio_direction_output()
110 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_direction_input() local
111 u8 reg = stmpe->regs[STMPE_IDX_GPDR_LSB + (offset / 8)]; in stmpe_gpio_direction_input()
114 return stmpe_set_bits(stmpe, reg, mask, 0); in stmpe_gpio_direction_input()
120 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_request() local
125 return stmpe_set_altfunc(stmpe, BIT(offset), STMPE_BLOCK_GPIO); in stmpe_gpio_request()
152 if (stmpe_gpio->stmpe->partnum == STMPE801 || in stmpe_gpio_irq_set_type()
153 stmpe_gpio->stmpe->partnum == STMPE1600) in stmpe_gpio_irq_set_type()
181 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_irq_sync_unlock() local
182 int num_banks = DIV_ROUND_UP(stmpe->num_gpios, 8); in stmpe_gpio_irq_sync_unlock()
201 if (stmpe->partnum == STMPE1600) { in stmpe_gpio_irq_sync_unlock()
202 stmpe_reg_read(stmpe, stmpe->regs[STMPE_IDX_GPMR_LSB]); in stmpe_gpio_irq_sync_unlock()
203 stmpe_reg_read(stmpe, stmpe->regs[STMPE_IDX_GPMR_CSB]); in stmpe_gpio_irq_sync_unlock()
208 if ((stmpe->partnum == STMPE801 || in stmpe_gpio_irq_sync_unlock()
209 stmpe->partnum == STMPE1600) && in stmpe_gpio_irq_sync_unlock()
221 stmpe_reg_write(stmpe, stmpe->regs[regmap[i][j]], new); in stmpe_gpio_irq_sync_unlock()
257 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_dbg_show_one() local
261 u8 dir_reg = stmpe->regs[STMPE_IDX_GPDR_LSB + bank]; in stmpe_dbg_show_one()
266 ret = stmpe_reg_read(stmpe, dir_reg); in stmpe_dbg_show_one()
302 switch (stmpe->partnum) { in stmpe_dbg_show_one()
308 edge_det_reg = stmpe->regs[STMPE_IDX_GPEDR_LSB + bank]; in stmpe_dbg_show_one()
309 ret = stmpe_reg_read(stmpe, edge_det_reg); in stmpe_dbg_show_one()
315 rise_reg = stmpe->regs[STMPE_IDX_GPRER_LSB + bank]; in stmpe_dbg_show_one()
316 fall_reg = stmpe->regs[STMPE_IDX_GPFER_LSB + bank]; in stmpe_dbg_show_one()
318 ret = stmpe_reg_read(stmpe, rise_reg); in stmpe_dbg_show_one()
322 ret = stmpe_reg_read(stmpe, fall_reg); in stmpe_dbg_show_one()
329 irqen_reg = stmpe->regs[STMPE_IDX_IEGPIOR_LSB + bank]; in stmpe_dbg_show_one()
336 ret = stmpe_reg_read(stmpe, irqen_reg); in stmpe_dbg_show_one()
378 struct stmpe *stmpe = stmpe_gpio->stmpe; in stmpe_gpio_irq() local
380 int num_banks = DIV_ROUND_UP(stmpe->num_gpios, 8); in stmpe_gpio_irq()
393 if (stmpe->partnum == STMPE1600) in stmpe_gpio_irq()
394 statmsbreg = stmpe->regs[STMPE_IDX_ISGPIOR_LSB]; in stmpe_gpio_irq()
396 statmsbreg = stmpe->regs[STMPE_IDX_ISGPIOR_MSB]; in stmpe_gpio_irq()
398 ret = stmpe_block_read(stmpe, statmsbreg, num_banks, status); in stmpe_gpio_irq()
403 int bank = (stmpe_gpio->stmpe->partnum == STMPE1600) ? i : in stmpe_gpio_irq()
427 if (stmpe->partnum != STMPE801 && stmpe->partnum != STMPE1600 && in stmpe_gpio_irq()
428 stmpe->partnum != STMPE1801) { in stmpe_gpio_irq()
429 stmpe_reg_write(stmpe, statmsbreg + i, status[i]); in stmpe_gpio_irq()
430 stmpe_reg_write(stmpe, in stmpe_gpio_irq()
431 stmpe->regs[STMPE_IDX_GPEDR_MSB] + i, in stmpe_gpio_irq()
456 static void stmpe_gpio_disable(void *stmpe) in stmpe_gpio_disable() argument
458 stmpe_disable(stmpe, STMPE_BLOCK_GPIO); in stmpe_gpio_disable()
463 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); in stmpe_gpio_probe() local
468 if (stmpe->num_gpios > MAX_GPIOS) { in stmpe_gpio_probe()
480 stmpe_gpio->stmpe = stmpe; in stmpe_gpio_probe()
482 stmpe_gpio->chip.ngpio = stmpe->num_gpios; in stmpe_gpio_probe()
498 ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO); in stmpe_gpio_probe()
502 ret = devm_add_action_or_reset(&pdev->dev, stmpe_gpio_disable, stmpe); in stmpe_gpio_probe()