]> Git Repo - J-u-boot.git/blame - drivers/pch/pch-uclass.c
usb: gadget: Add gadget_is_cdns3() macro
[J-u-boot.git] / drivers / pch / pch-uclass.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
452f5487
SG
2/*
3 * Copyright (c) 2015 Google, Inc
4 * Written by Simon Glass <[email protected]>
452f5487
SG
5 */
6
7#include <common.h>
8#include <dm.h>
ca831f49 9#include <pch.h>
452f5487 10
3e389d8b 11int pch_get_spi_base(struct udevice *dev, ulong *sbasep)
ca831f49
SG
12{
13 struct pch_ops *ops = pch_get_ops(dev);
14
15 *sbasep = 0;
3e389d8b 16 if (!ops->get_spi_base)
ca831f49
SG
17 return -ENOSYS;
18
3e389d8b 19 return ops->get_spi_base(dev, sbasep);
ca831f49
SG
20}
21
ca831f49
SG
22int pch_set_spi_protect(struct udevice *dev, bool protect)
23{
24 struct pch_ops *ops = pch_get_ops(dev);
25
26 if (!ops->set_spi_protect)
27 return -ENOSYS;
28
29 return ops->set_spi_protect(dev, protect);
30}
31
384980c6
BM
32int pch_get_gpio_base(struct udevice *dev, u32 *gbasep)
33{
34 struct pch_ops *ops = pch_get_ops(dev);
35
36 *gbasep = 0;
37 if (!ops->get_gpio_base)
38 return -ENOSYS;
39
40 return ops->get_gpio_base(dev, gbasep);
41}
42
79d4eb62
BM
43int pch_get_io_base(struct udevice *dev, u32 *iobasep)
44{
45 struct pch_ops *ops = pch_get_ops(dev);
46
47 *iobasep = 0;
48 if (!ops->get_io_base)
49 return -ENOSYS;
50
51 return ops->get_io_base(dev, iobasep);
52}
53
1260f8c0
SG
54int pch_ioctl(struct udevice *dev, ulong req, void *data, int size)
55{
56 struct pch_ops *ops = pch_get_ops(dev);
57
58 if (!ops->ioctl)
59 return -ENOSYS;
60
61 return ops->ioctl(dev, req, data, size);
62}
63
452f5487
SG
64UCLASS_DRIVER(pch) = {
65 .id = UCLASS_PCH,
66 .name = "pch",
12e927b0 67#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
91195485 68 .post_bind = dm_scan_fdt_dev,
12e927b0 69#endif
452f5487 70};
This page took 0.288689 seconds and 4 git commands to generate.