linux/drivers/usb/core/ledtrig-usbport.c

// SPDX-License-Identifier: GPL-2.0
/*
 * USB port LED trigger
 *
 * Copyright (C) 2016 Rafał Miłecki <[email protected]>
 */

#include <linux/device.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/usb/of.h>

struct usbport_trig_data {};

struct usbport_trig_port {};

/***************************************
 * Helpers
 ***************************************/

/*
 * usbport_trig_usb_dev_observed - Check if dev is connected to observed port
 */
static bool usbport_trig_usb_dev_observed(struct usbport_trig_data *usbport_data,
					  struct usb_device *usb_dev)
{}

static int usbport_trig_usb_dev_check(struct usb_device *usb_dev, void *data)
{}

/*
 * usbport_trig_update_count - Recalculate amount of connected matching devices
 */
static void usbport_trig_update_count(struct usbport_trig_data *usbport_data)
{}

/***************************************
 * Device attr
 ***************************************/

static ssize_t usbport_trig_port_show(struct device *dev,
				      struct device_attribute *attr, char *buf)
{}

static ssize_t usbport_trig_port_store(struct device *dev,
				       struct device_attribute *attr,
				       const char *buf, size_t size)
{}

static struct attribute *ports_attrs[] =;

static const struct attribute_group ports_group =;

/***************************************
 * Adding & removing ports
 ***************************************/

/*
 * usbport_trig_port_observed - Check if port should be observed
 */
static bool usbport_trig_port_observed(struct usbport_trig_data *usbport_data,
				       struct usb_device *usb_dev, int port1)
{}

static int usbport_trig_add_port(struct usbport_trig_data *usbport_data,
				 struct usb_device *usb_dev,
				 const char *hub_name, int portnum)
{}

static int usbport_trig_add_usb_dev_ports(struct usb_device *usb_dev,
					  void *data)
{}

static void usbport_trig_remove_port(struct usbport_trig_data *usbport_data,
				     struct usbport_trig_port *port)
{}

static void usbport_trig_remove_usb_dev_ports(struct usbport_trig_data *usbport_data,
					      struct usb_device *usb_dev)
{}

/***************************************
 * Init, exit, etc.
 ***************************************/

static int usbport_trig_notify(struct notifier_block *nb, unsigned long action,
			       void *data)
{}

static int usbport_trig_activate(struct led_classdev *led_cdev)
{}

static void usbport_trig_deactivate(struct led_classdev *led_cdev)
{}

static struct led_trigger usbport_led_trigger =;

module_led_trigger();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();