From 032a125904995985334766911de9e26ee2bbd646 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 14 Jan 2022 12:45:35 +0100 Subject: drm/dp: Move DisplayPort AUX bus helpers into dp/ Move drm_dp_aux_bus.c and its header file into the DP subdirectory and update all users. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220114114535.29157-6-tzimmermann@suse.de --- include/drm/dp/drm_dp_aux_bus.h | 57 +++++++++++++++++++++++++++++++++++++++++ include/drm/drm_dp_aux_bus.h | 57 ----------------------------------------- 2 files changed, 57 insertions(+), 57 deletions(-) create mode 100644 include/drm/dp/drm_dp_aux_bus.h delete mode 100644 include/drm/drm_dp_aux_bus.h (limited to 'include/drm') diff --git a/include/drm/dp/drm_dp_aux_bus.h b/include/drm/dp/drm_dp_aux_bus.h new file mode 100644 index 000000000000..4f19b20b1dd6 --- /dev/null +++ b/include/drm/dp/drm_dp_aux_bus.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2021 Google Inc. + * + * The DP AUX bus is used for devices that are connected over a DisplayPort + * AUX bus. The devices on the far side of the bus are referred to as + * endpoints in this code. + */ + +#ifndef _DP_AUX_BUS_H_ +#define _DP_AUX_BUS_H_ + +#include +#include + +/** + * struct dp_aux_ep_device - Main dev structure for DP AUX endpoints + * + * This is used to instantiate devices that are connected via a DP AUX + * bus. Usually the device is a panel, but conceivable other devices could + * be hooked up there. + */ +struct dp_aux_ep_device { + /** @dev: The normal dev pointer */ + struct device dev; + /** @aux: Pointer to the aux bus */ + struct drm_dp_aux *aux; +}; + +struct dp_aux_ep_driver { + int (*probe)(struct dp_aux_ep_device *aux_ep); + void (*remove)(struct dp_aux_ep_device *aux_ep); + void (*shutdown)(struct dp_aux_ep_device *aux_ep); + struct device_driver driver; +}; + +static inline struct dp_aux_ep_device *to_dp_aux_ep_dev(struct device *dev) +{ + return container_of(dev, struct dp_aux_ep_device, dev); +} + +static inline struct dp_aux_ep_driver *to_dp_aux_ep_drv(struct device_driver *drv) +{ + return container_of(drv, struct dp_aux_ep_driver, driver); +} + +int of_dp_aux_populate_ep_devices(struct drm_dp_aux *aux); +void of_dp_aux_depopulate_ep_devices(struct drm_dp_aux *aux); +int devm_of_dp_aux_populate_ep_devices(struct drm_dp_aux *aux); + +#define dp_aux_dp_driver_register(aux_ep_drv) \ + __dp_aux_dp_driver_register(aux_ep_drv, THIS_MODULE) +int __dp_aux_dp_driver_register(struct dp_aux_ep_driver *aux_ep_drv, + struct module *owner); +void dp_aux_dp_driver_unregister(struct dp_aux_ep_driver *aux_ep_drv); + +#endif /* _DP_AUX_BUS_H_ */ diff --git a/include/drm/drm_dp_aux_bus.h b/include/drm/drm_dp_aux_bus.h deleted file mode 100644 index 4f19b20b1dd6..000000000000 --- a/include/drm/drm_dp_aux_bus.h +++ /dev/null @@ -1,57 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright 2021 Google Inc. - * - * The DP AUX bus is used for devices that are connected over a DisplayPort - * AUX bus. The devices on the far side of the bus are referred to as - * endpoints in this code. - */ - -#ifndef _DP_AUX_BUS_H_ -#define _DP_AUX_BUS_H_ - -#include -#include - -/** - * struct dp_aux_ep_device - Main dev structure for DP AUX endpoints - * - * This is used to instantiate devices that are connected via a DP AUX - * bus. Usually the device is a panel, but conceivable other devices could - * be hooked up there. - */ -struct dp_aux_ep_device { - /** @dev: The normal dev pointer */ - struct device dev; - /** @aux: Pointer to the aux bus */ - struct drm_dp_aux *aux; -}; - -struct dp_aux_ep_driver { - int (*probe)(struct dp_aux_ep_device *aux_ep); - void (*remove)(struct dp_aux_ep_device *aux_ep); - void (*shutdown)(struct dp_aux_ep_device *aux_ep); - struct device_driver driver; -}; - -static inline struct dp_aux_ep_device *to_dp_aux_ep_dev(struct device *dev) -{ - return container_of(dev, struct dp_aux_ep_device, dev); -} - -static inline struct dp_aux_ep_driver *to_dp_aux_ep_drv(struct device_driver *drv) -{ - return container_of(drv, struct dp_aux_ep_driver, driver); -} - -int of_dp_aux_populate_ep_devices(struct drm_dp_aux *aux); -void of_dp_aux_depopulate_ep_devices(struct drm_dp_aux *aux); -int devm_of_dp_aux_populate_ep_devices(struct drm_dp_aux *aux); - -#define dp_aux_dp_driver_register(aux_ep_drv) \ - __dp_aux_dp_driver_register(aux_ep_drv, THIS_MODULE) -int __dp_aux_dp_driver_register(struct dp_aux_ep_driver *aux_ep_drv, - struct module *owner); -void dp_aux_dp_driver_unregister(struct dp_aux_ep_driver *aux_ep_drv); - -#endif /* _DP_AUX_BUS_H_ */ -- cgit v1.2.3