1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2018 Google LLC
10 struct sandbox_pch_priv
{
14 int sandbox_get_pch_spi_protect(struct udevice
*dev
)
16 struct sandbox_pch_priv
*priv
= dev_get_priv(dev
);
21 static int sandbox_pch_get_spi_base(struct udevice
*dev
, ulong
*sbasep
)
28 static int sandbox_pch_set_spi_protect(struct udevice
*dev
, bool protect
)
30 struct sandbox_pch_priv
*priv
= dev_get_priv(dev
);
32 priv
->protect
= protect
;
37 static int sandbox_pch_get_gpio_base(struct udevice
*dev
, u32
*gbasep
)
44 static int sandbox_pch_get_io_base(struct udevice
*dev
, u32
*iobasep
)
51 int sandbox_pch_ioctl(struct udevice
*dev
, enum pch_req_t req
, void *data
,
67 static const struct pch_ops sandbox_pch_ops
= {
68 .get_spi_base
= sandbox_pch_get_spi_base
,
69 .set_spi_protect
= sandbox_pch_set_spi_protect
,
70 .get_gpio_base
= sandbox_pch_get_gpio_base
,
71 .get_io_base
= sandbox_pch_get_io_base
,
72 .ioctl
= sandbox_pch_ioctl
,
75 static const struct udevice_id sandbox_pch_ids
[] = {
76 { .compatible
= "sandbox,pch" },
80 U_BOOT_DRIVER(sandbox_pch_drv
) = {
81 .name
= "sandbox-pch",
83 .of_match
= sandbox_pch_ids
,
84 .ops
= &sandbox_pch_ops
,
85 .priv_auto_alloc_size
= sizeof(struct sandbox_pch_priv
),