p2wi 96 drivers/i2c/busses/i2c-sun6i-p2wi.c struct p2wi *p2wi = dev_id; p2wi 99 drivers/i2c/busses/i2c-sun6i-p2wi.c status = readl(p2wi->regs + P2WI_INTS); p2wi 100 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->status = status; p2wi 105 drivers/i2c/busses/i2c-sun6i-p2wi.c writel(status, p2wi->regs + P2WI_INTS); p2wi 107 drivers/i2c/busses/i2c-sun6i-p2wi.c complete(&p2wi->complete); p2wi 121 drivers/i2c/busses/i2c-sun6i-p2wi.c struct p2wi *p2wi = i2c_get_adapdata(adap); p2wi 124 drivers/i2c/busses/i2c-sun6i-p2wi.c if (p2wi->slave_addr >= 0 && addr != p2wi->slave_addr) { p2wi 132 drivers/i2c/busses/i2c-sun6i-p2wi.c writel(command, p2wi->regs + P2WI_DADDR0); p2wi 137 drivers/i2c/busses/i2c-sun6i-p2wi.c writel(data->byte, p2wi->regs + P2WI_DATA0); p2wi 139 drivers/i2c/busses/i2c-sun6i-p2wi.c writel(dlen, p2wi->regs + P2WI_DLEN); p2wi 141 drivers/i2c/busses/i2c-sun6i-p2wi.c if (readl(p2wi->regs + P2WI_CTRL) & P2WI_CTRL_START_TRANS) { p2wi 146 drivers/i2c/busses/i2c-sun6i-p2wi.c reinit_completion(&p2wi->complete); p2wi 149 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->regs + P2WI_INTE); p2wi 152 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->regs + P2WI_CTRL); p2wi 154 drivers/i2c/busses/i2c-sun6i-p2wi.c wait_for_completion(&p2wi->complete); p2wi 156 drivers/i2c/busses/i2c-sun6i-p2wi.c if (p2wi->status & P2WI_INTS_LOAD_BSY) { p2wi 161 drivers/i2c/busses/i2c-sun6i-p2wi.c if (p2wi->status & P2WI_INTS_TRANS_ERR) { p2wi 167 drivers/i2c/busses/i2c-sun6i-p2wi.c data->byte = readl(p2wi->regs + P2WI_DATA0); p2wi 191 drivers/i2c/busses/i2c-sun6i-p2wi.c struct p2wi *p2wi; p2wi 210 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi = devm_kzalloc(dev, sizeof(struct p2wi), GFP_KERNEL); p2wi 211 drivers/i2c/busses/i2c-sun6i-p2wi.c if (!p2wi) p2wi 214 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->slave_addr = -1; p2wi 231 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->slave_addr = slave_addr; p2wi 235 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->regs = devm_ioremap_resource(dev, r); p2wi 236 drivers/i2c/busses/i2c-sun6i-p2wi.c if (IS_ERR(p2wi->regs)) p2wi 237 drivers/i2c/busses/i2c-sun6i-p2wi.c return PTR_ERR(p2wi->regs); p2wi 239 drivers/i2c/busses/i2c-sun6i-p2wi.c strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name)); p2wi 246 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->clk = devm_clk_get(dev, NULL); p2wi 247 drivers/i2c/busses/i2c-sun6i-p2wi.c if (IS_ERR(p2wi->clk)) { p2wi 248 drivers/i2c/busses/i2c-sun6i-p2wi.c ret = PTR_ERR(p2wi->clk); p2wi 253 drivers/i2c/busses/i2c-sun6i-p2wi.c ret = clk_prepare_enable(p2wi->clk); p2wi 259 drivers/i2c/busses/i2c-sun6i-p2wi.c parent_clk_freq = clk_get_rate(p2wi->clk); p2wi 261 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->rstc = devm_reset_control_get_exclusive(dev, NULL); p2wi 262 drivers/i2c/busses/i2c-sun6i-p2wi.c if (IS_ERR(p2wi->rstc)) { p2wi 263 drivers/i2c/busses/i2c-sun6i-p2wi.c ret = PTR_ERR(p2wi->rstc); p2wi 268 drivers/i2c/busses/i2c-sun6i-p2wi.c ret = reset_control_deassert(p2wi->rstc); p2wi 274 drivers/i2c/busses/i2c-sun6i-p2wi.c init_completion(&p2wi->complete); p2wi 275 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->adapter.dev.parent = dev; p2wi 276 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->adapter.algo = &p2wi_algo; p2wi 277 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->adapter.owner = THIS_MODULE; p2wi 278 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->adapter.dev.of_node = pdev->dev.of_node; p2wi 279 drivers/i2c/busses/i2c-sun6i-p2wi.c platform_set_drvdata(pdev, p2wi); p2wi 280 drivers/i2c/busses/i2c-sun6i-p2wi.c i2c_set_adapdata(&p2wi->adapter, p2wi); p2wi 282 drivers/i2c/busses/i2c-sun6i-p2wi.c ret = devm_request_irq(dev, irq, p2wi_interrupt, 0, pdev->name, p2wi); p2wi 289 drivers/i2c/busses/i2c-sun6i-p2wi.c writel(P2WI_CTRL_SOFT_RST, p2wi->regs + P2WI_CTRL); p2wi 305 drivers/i2c/busses/i2c-sun6i-p2wi.c p2wi->regs + P2WI_CCR); p2wi 307 drivers/i2c/busses/i2c-sun6i-p2wi.c ret = i2c_add_adapter(&p2wi->adapter); p2wi 312 drivers/i2c/busses/i2c-sun6i-p2wi.c reset_control_assert(p2wi->rstc); p2wi 315 drivers/i2c/busses/i2c-sun6i-p2wi.c clk_disable_unprepare(p2wi->clk); p2wi 322 drivers/i2c/busses/i2c-sun6i-p2wi.c struct p2wi *p2wi = platform_get_drvdata(dev); p2wi 324 drivers/i2c/busses/i2c-sun6i-p2wi.c reset_control_assert(p2wi->rstc); p2wi 325 drivers/i2c/busses/i2c-sun6i-p2wi.c clk_disable_unprepare(p2wi->clk); p2wi 326 drivers/i2c/busses/i2c-sun6i-p2wi.c i2c_del_adapter(&p2wi->adapter);