Lines Matching +full:rzv2m +full:- +full:pwc +full:- +full:power
1 // SPDX-License-Identifier: GPL-2.0-only
38 writel(reg, priv->base + PWC_GPIO); in rzv2m_pwc_gpio_set()
40 assign_bit(offset, priv->ch_en_bits, value); in rzv2m_pwc_gpio_set()
47 return test_bit(offset, priv->ch_en_bits); in rzv2m_pwc_gpio_get()
54 return -EINVAL; in rzv2m_pwc_gpio_direction_output()
69 .base = -1,
74 struct rzv2m_pwc_priv *priv = data->cb_data; in rzv2m_pwc_poweroff()
76 writel(PWC_PWCRST_RSTSOFTAX, priv->base + PWC_PWCRST); in rzv2m_pwc_poweroff()
77 writel(PWC_PWCCKEN_ENGCKMAIN, priv->base + PWC_PWCCKEN); in rzv2m_pwc_poweroff()
78 writel(PWC_PWCCTL_PWOFF, priv->base + PWC_PWCCTL); in rzv2m_pwc_poweroff()
82 dev_err(priv->dev, "Failed to power off the system"); in rzv2m_pwc_poweroff()
92 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in rzv2m_pwc_probe()
94 return -ENOMEM; in rzv2m_pwc_probe()
96 priv->base = devm_platform_ioremap_resource(pdev, 0); in rzv2m_pwc_probe()
97 if (IS_ERR(priv->base)) in rzv2m_pwc_probe()
98 return PTR_ERR(priv->base); in rzv2m_pwc_probe()
102 * outputs to their default values and initialize priv->ch_en_bits in rzv2m_pwc_probe()
106 writel(BIT(17) | BIT(16), priv->base + PWC_GPIO); in rzv2m_pwc_probe()
107 bitmap_zero(priv->ch_en_bits, 2); in rzv2m_pwc_probe()
109 priv->gp = rzv2m_pwc_gc; in rzv2m_pwc_probe()
110 priv->gp.parent = pdev->dev.parent; in rzv2m_pwc_probe()
111 priv->gp.fwnode = dev_fwnode(&pdev->dev); in rzv2m_pwc_probe()
113 ret = devm_gpiochip_add_data(&pdev->dev, &priv->gp, priv); in rzv2m_pwc_probe()
117 if (device_property_read_bool(&pdev->dev, "renesas,rzv2m-pwc-power")) in rzv2m_pwc_probe()
118 ret = devm_register_power_off_handler(&pdev->dev, in rzv2m_pwc_probe()
125 { .compatible = "renesas,rzv2m-pwc" },
141 MODULE_DESCRIPTION("Renesas RZ/V2M PWC driver");