USBGadget设备驱动开发(三)usbwebcam驱动加载脚本实现
USBGadget设备驱动开发(三)usbwebcam驱动加载脚本实
S55webcam.sh ⽂件:
#!/bin/sh
echo $"*****************************************"
echo $"*************** webcam *****************"
echo $"*****************************************"
echo $"Usage: $0 $1"
case "$1" in
start)
/usr/local/share/script/usb_webcam.sh start
;
;
stop)
/usr/local/share/script/usb_webcam.sh stop
竞选团支书;;
restart|reload)
"$0" stop
"$0" start凝固的反义词
;;
*)
echo $"Usage: $0 {start|stop|restart}"
esac
exit $?
堃的拼音怎么读usb_webcam.sh ⽂件:
#!/bin/sh
#
# Init
#
if [ -f /f ]; then
. /f
fi
start()
{
kernel_ver=$(uname -r)
SYS_USB_G_TYPE="webcam"
echo device > /proc/ambarella/usbphy0
#Install USB module
if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/usb-common.ko ]; then
modprobe usb-common
fi
if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/core/usbcore.ko ]; then
modprobe usbcore
fi
#        if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/host/ehci-hcd.ko ]; then
#                modprobe ehci-hcd
#        fi
#        if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/host/ohci-hcd.ko ]; then
#                modprobe ohci-hcd
#        fi
if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/gadget/udc-core.ko ]; then
modprobe udc-core
fi
老榕树
if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/gadget/ambarella_udc.ko ]; then
顺丰快递单号查询
modprobe ambarella_udc
fi
2本
if [ -r /lib/modules/$kernel_ver/kernel/drivers/media/v4l2-core/videobuf2-core.ko ]; then
modprobe videobuf2-core
fi
if [ -r /lib/modules/$kernel_ver/kernel/drivers/media/v4l2-core/videobuf2-memops.ko ]; then                modprobe videobuf2-memops
fi
if [ -r /lib/modules/$kernel_ver/kernel/drivers/media/v4l2-core/videobuf2-vmalloc.ko ]; then                modprobe videobuf2-vmalloc
fi
if [ -r /lib/modules/$kernel_ver/kernel/fs/configfs/configfs.ko ]; then
modprobe configfs
fi
if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/gadget/libcomposite.ko ]; then
modprobe libcomposite
fi
if [ -r /lib/modules/$kernel_ver/kernel/drivers/usb/gadget/g_$SYS_USB_G_TYPE.ko ]; then
modprobe g_$SYS_USB_G_TYPE
fi
}
stop()
{
kernel_ver=$(uname -r)
}
restart()
{
stop
start
}
case "$1" in
start)
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"                exit 1
esac
exit $?

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。