1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2015 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
7 #define LOG_CATEGORY UCLASS_PCH
13 int pch_get_spi_base(struct udevice *dev, ulong *sbasep)
15 struct pch_ops *ops = pch_get_ops(dev);
18 if (!ops->get_spi_base)
21 return ops->get_spi_base(dev, sbasep);
24 int pch_set_spi_protect(struct udevice *dev, bool protect)
26 struct pch_ops *ops = pch_get_ops(dev);
28 if (!ops->set_spi_protect)
31 return ops->set_spi_protect(dev, protect);
34 int pch_get_gpio_base(struct udevice *dev, u32 *gbasep)
36 struct pch_ops *ops = pch_get_ops(dev);
39 if (!ops->get_gpio_base)
42 return ops->get_gpio_base(dev, gbasep);
45 int pch_get_io_base(struct udevice *dev, u32 *iobasep)
47 struct pch_ops *ops = pch_get_ops(dev);
50 if (!ops->get_io_base)
53 return ops->get_io_base(dev, iobasep);
56 int pch_ioctl(struct udevice *dev, ulong req, void *data, int size)
58 struct pch_ops *ops = pch_get_ops(dev);
63 return ops->ioctl(dev, req, data, size);
66 UCLASS_DRIVER(pch) = {
69 #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
70 .post_bind = dm_scan_fdt_dev,