drm/udl: Add reset_resume
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 8 Sep 2022 09:51:05 +0000 (11:51 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Sat, 10 Sep 2022 19:45:45 +0000 (21:45 +0200)
Implement the reset_resume callback of struct usb_driver. Set the
standard channel when called.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-3-tiwai@suse.de
drivers/gpu/drm/udl/udl_drv.c
drivers/gpu/drm/udl/udl_drv.h
drivers/gpu/drm/udl/udl_main.c

index 5703277c6f5276197f1d5a4c5d8d6ae76723456b..0ba88e5472a9fa0fa38534d5daa5a7c16c1fde25 100644 (file)
@@ -32,6 +32,16 @@ static int udl_usb_resume(struct usb_interface *interface)
        return drm_mode_config_helper_resume(dev);
 }
 
+static int udl_usb_reset_resume(struct usb_interface *interface)
+{
+       struct drm_device *dev = usb_get_intfdata(interface);
+       struct udl_device *udl = to_udl(dev);
+
+       udl_select_std_channel(udl);
+
+       return drm_mode_config_helper_resume(dev);
+}
+
 /*
  * FIXME: Dma-buf sharing requires DMA support by the importing device.
  *        This function is a workaround to make USB devices work as well.
@@ -140,6 +150,7 @@ static struct usb_driver udl_driver = {
        .disconnect = udl_usb_disconnect,
        .suspend = udl_usb_suspend,
        .resume = udl_usb_resume,
+       .reset_resume = udl_usb_reset_resume,
        .id_table = id_table,
 };
 module_usb_driver(udl_driver);
index 28aaf75d71cf09ffadbcace9acc7506cff3b0793..37c14b0ff1fc7ce25932df305256777510649111 100644 (file)
@@ -95,6 +95,7 @@ int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
                     u32 byte_offset, u32 device_byte_offset, u32 byte_width);
 
 int udl_drop_usb(struct drm_device *dev);
+int udl_select_std_channel(struct udl_device *udl);
 
 #define CMD_WRITE_RAW8   "\xAF\x60" /**< 8 bit raw write command. */
 #define CMD_WRITE_RL8    "\xAF\x61" /**< 8 bit run length command. */
index fdafbf8f3c3cb083b1cd03029d1089ce21bc267c..7d1e6bbc165c50b3a1219ec05776c9806beff546 100644 (file)
@@ -92,7 +92,7 @@ success:
 /*
  * Need to ensure a channel is selected before submitting URBs
  */
-static int udl_select_std_channel(struct udl_device *udl)
+int udl_select_std_channel(struct udl_device *udl)
 {
        static const u8 set_def_chn[] = {0x57, 0xCD, 0xDC, 0xA7,
                                         0x1C, 0x88, 0x5E, 0x15,