| // SPDX-License-Identifier: GPL-2.0+ |
| * Qualcomm PSHOLD reset driver |
| * Copyright (c) 2024 Sartura Ltd. |
| * Author: Robert Marko <robert.marko@sartura.hr> |
| * Based on the Linux msm-poweroff driver. |
| struct qcom_pshold_priv { |
| static int qcom_pshold_request(struct udevice *dev, enum sysreset_t type) |
| struct qcom_pshold_priv *priv = dev_get_priv(dev); |
| static struct sysreset_ops qcom_pshold_ops = { |
| .request = qcom_pshold_request, |
| static int qcom_pshold_probe(struct udevice *dev) |
| struct qcom_pshold_priv *priv = dev_get_priv(dev); |
| priv->base = dev_read_addr(dev); |
| return priv->base == FDT_ADDR_T_NONE ? -EINVAL : 0; |
| static const struct udevice_id qcom_pshold_ids[] = { |
| { .compatible = "qcom,pshold", }, |
| U_BOOT_DRIVER(qcom_pshold) = { |
| .of_match = qcom_pshold_ids, |
| .probe = qcom_pshold_probe, |
| .priv_auto = sizeof(struct qcom_pshold_priv), |