USBGadget设备驱动开发(三)usbwebcam驱动加载脚本实
现
S55webcam.sh ⽂件:
#!/bin/sh
echo $"*****************************************"
echo $"*************** webcam *****************"
echo $"*****************************************"
echo $"Usage: $0 $1"
ca "$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
心情不好的说说
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
}
ca "$1" in
start)
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}" exit 1
esac
exit $?