blob: 78eedf676b09324610009e3fb992ebd5defae318 [file] [log] [blame]
Mark Kettenisb99c6352023-07-14 22:21:42 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2022 Mark Kettenis <kettenis@openbsd.org>
4 */
5
Mark Kettenisb99c6352023-07-14 22:21:42 +02006#include <dm.h>
7#include <dm/device-internal.h>
8#include <generic-phy.h>
9#include <reset-uclass.h>
10
11static const struct phy_ops apple_atcphy_ops = {
12};
13
14static struct driver apple_atcphy_driver = {
15 .name = "apple-atcphy",
16 .id = UCLASS_PHY,
17 .ops = &apple_atcphy_ops,
18};
19
20static int apple_atcphy_reset_of_xlate(struct reset_ctl *reset_ctl,
21 struct ofnode_phandle_args *args)
22{
23 if (args->args_count != 0)
24 return -EINVAL;
25
26 return 0;
27}
28
29static const struct reset_ops apple_atcphy_reset_ops = {
30 .of_xlate = apple_atcphy_reset_of_xlate,
31};
32
33static int apple_atcphy_reset_probe(struct udevice *dev)
34{
35 struct udevice *child;
36
37 device_bind(dev, &apple_atcphy_driver, "apple-atcphy", NULL,
38 dev_ofnode(dev), &child);
39
40 return 0;
41}
42
43static const struct udevice_id apple_atcphy_ids[] = {
44 { .compatible = "apple,t6000-atcphy" },
45 { .compatible = "apple,t8103-atcphy" },
46 { }
47};
48
49U_BOOT_DRIVER(apple_atcphy_reset) = {
50 .name = "apple-atcphy-reset",
51 .id = UCLASS_RESET,
52 .of_match = apple_atcphy_ids,
53 .ops = &apple_atcphy_reset_ops,
54 .probe = apple_atcphy_reset_probe,
55};