2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
17 /* Operations for the Platform Controller Hub */
20 * get_sbase() - get the address of SPI base
22 * @dev: PCH device to check
23 * @sbasep: Returns address of SPI base if available, else 0
24 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
26 int (*get_sbase)(struct udevice *dev, ulong *sbasep);
29 * get_version() - get the PCH version
31 * @return version, or -ENOSYS if unknown
33 enum pch_version (*get_version)(struct udevice *dev);
36 * set_spi_protect() - set whether SPI flash is protected or not
38 * @dev: PCH device to adjust
39 * @protect: true to protect, false to unprotect
41 * @return 0 on success, -ENOSYS if not implemented
43 int (*set_spi_protect)(struct udevice *dev, bool protect);
46 #define pch_get_ops(dev) ((struct pch_ops *)(dev)->driver->ops)
49 * pch_get_sbase() - get the address of SPI base
51 * @dev: PCH device to check
52 * @sbasep: Returns address of SPI base if available, else 0
53 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
55 int pch_get_sbase(struct udevice *dev, ulong *sbasep);
58 * pch_get_version() - get the PCH version
60 * @return version, or -ENOSYS if unknown
62 enum pch_version pch_get_version(struct udevice *dev);
65 * set_spi_protect() - set whether SPI flash is protected or not
67 * @dev: PCH device to adjust
68 * @protect: true to protect, false to unprotect
70 * @return 0 on success, -ENOSYS if not implemented
72 int pch_set_spi_protect(struct udevice *dev, bool protect);