]>
git.ipfire.org Git - people/ms/u-boot.git/blob - video_bridge.h
c7b8681849c7da82421a8bc44d4a14410506440d
2 * Copyright (C) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
14 * struct video_bridge_priv - uclass information for video bridges
16 * @sleep: GPIO to assert to power down the bridge
17 * @reset: GPIO to assert to reset the bridge
18 * @hotplug: Optional GPIO to check if bridge is connected
20 struct video_bridge_priv
{
21 struct gpio_desc sleep
;
22 struct gpio_desc reset
;
23 struct gpio_desc hotplug
;
27 * Operations for video bridges
29 struct video_bridge_ops
{
31 * attach() - attach a video bridge
33 * @return 0 if OK, -ve on error
35 int (*attach
)(struct udevice
*dev
);
38 * check_attached() - check if a bridge is correctly attached
40 * This method is optional - if not provided then the hotplug GPIO
41 * will be checked instead.
43 * @dev: Device to check
44 * @return 0 if attached, -EENOTCONN if not, or other -ve error
46 int (*check_attached
)(struct udevice
*dev
);
49 * set_backlight() - Set the backlight brightness
51 * @dev: device to adjust
52 * @percent: brightness percentage (0=off, 100=full brightness)
53 * @return 0 if OK, -ve on error
55 int (*set_backlight
)(struct udevice
*dev
, int percent
);
58 #define video_bridge_get_ops(dev) \
59 ((struct video_bridge_ops *)(dev)->driver->ops)
62 * video_bridge_attach() - attach a video bridge
64 * @return 0 if OK, -ve on error
66 int video_bridge_attach(struct udevice
*dev
);
69 * video_bridge_set_backlight() - Set the backlight brightness
71 * @percent: brightness percentage (0=off, 100=full brightness)
72 * @return 0 if OK, -ve on error
74 int video_bridge_set_backlight(struct udevice
*dev
, int percent
);
77 * video_bridge_set_active() - take the bridge in/out of reset/powerdown
79 * @dev: Device to adjust
80 * @active: true to power up and reset, false to power down
82 int video_bridge_set_active(struct udevice
*dev
, bool active
);
85 * check_attached() - check if a bridge is correctly attached
87 * @dev: Device to check
88 * @return 0 if attached, -EENOTCONN if not, or other -ve error
90 int video_bridge_check_attached(struct udevice
*dev
);