Lines Matching refs:mtk

52 struct mtk {  struct
69 struct mtk *mtk = gpiochip_get_data(gc); in mtk_gpio_w32() argument
72 gc->write_reg(mtk->base + offset, val); in mtk_gpio_w32()
79 struct mtk *mtk = gpiochip_get_data(gc); in mtk_gpio_r32() local
82 return gc->read_reg(mtk->base + offset); in mtk_gpio_r32()
223 struct mtk *mtk = dev_get_drvdata(dev); in mediatek_gpio_bank_probe() local
228 rg = &mtk->gc_map[bank]; in mediatek_gpio_bank_probe()
234 dat = mtk->base + GPIO_REG_DATA + (rg->bank * GPIO_BANK_STRIDE); in mediatek_gpio_bank_probe()
235 set = mtk->base + GPIO_REG_DSET + (rg->bank * GPIO_BANK_STRIDE); in mediatek_gpio_bank_probe()
236 ctrl = mtk->base + GPIO_REG_DCLR + (rg->bank * GPIO_BANK_STRIDE); in mediatek_gpio_bank_probe()
237 diro = mtk->base + GPIO_REG_CTRL + (rg->bank * GPIO_BANK_STRIDE); in mediatek_gpio_bank_probe()
255 if (mtk->gpio_irq) { in mediatek_gpio_bank_probe()
262 ret = devm_request_irq(dev, mtk->gpio_irq, in mediatek_gpio_bank_probe()
268 mtk->gpio_irq, ret); in mediatek_gpio_bank_probe()
282 ret = devm_gpiochip_add_data(dev, &rg->chip, mtk); in mediatek_gpio_bank_probe()
301 struct mtk *mtk; in mediatek_gpio_probe() local
305 mtk = devm_kzalloc(dev, sizeof(*mtk), GFP_KERNEL); in mediatek_gpio_probe()
306 if (!mtk) in mediatek_gpio_probe()
309 mtk->base = devm_platform_ioremap_resource(pdev, 0); in mediatek_gpio_probe()
310 if (IS_ERR(mtk->base)) in mediatek_gpio_probe()
311 return PTR_ERR(mtk->base); in mediatek_gpio_probe()
313 mtk->gpio_irq = platform_get_irq(pdev, 0); in mediatek_gpio_probe()
314 if (mtk->gpio_irq < 0) in mediatek_gpio_probe()
315 return mtk->gpio_irq; in mediatek_gpio_probe()
317 mtk->dev = dev; in mediatek_gpio_probe()
318 platform_set_drvdata(pdev, mtk); in mediatek_gpio_probe()