kernel 3.10 rebuild [release 2.1.0-12mamba;Sun Sep 15 2013]

This commit is contained in:
Silvan Calarco 2024-01-05 18:09:07 +01:00
parent 30198fe73a
commit 706b3cb3a6
4 changed files with 527 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# stk11xx
Linux/Unix driver development for Syntek Semicon USB2.0 Video device DC-1125, like the one that is found in Asus A6K laptops. The device can be recognized by the usb id 174f:a311 and maybe also be a standalone unit (not integrated).

View File

@ -0,0 +1,16 @@
diff -ruN driver.org//stk11xx-usb.c driver/stk11xx-usb.c
--- driver.org//stk11xx-usb.c 2011-01-06 21:51:53.674999852 +0200
+++ driver/stk11xx-usb.c 2011-01-06 21:56:44.418999851 +0200
@@ -844,7 +844,12 @@
}
// Init mutexes, spinlock, etc.
+
+#ifndef init_MUTEX
+ sema_init(&dev->mutex,1);
+#else
init_MUTEX(&dev->mutex);
+#endif
mutex_init(&dev->modlock);
spin_lock_init(&dev->spinlock);
init_waitqueue_head(&dev->wait_frame);

View File

@ -0,0 +1,364 @@
diff -Nru stk11xx-2.1.0.orig//stk11xx-sysfs.c stk11xx-2.1.0/stk11xx-sysfs.c
--- stk11xx-2.1.0.orig//stk11xx-sysfs.c 2009-03-25 15:13:05.000000000 +0100
+++ stk11xx-2.1.0/stk11xx-sysfs.c 2011-04-20 17:08:53.354592563 +0200
@@ -40,7 +40,6 @@
#include <linux/kref.h>
#include <linux/device.h>
#include <linux/mm.h>
-#include <linux/videodev.h>
#include <linux/usb.h>
diff -Nru stk11xx-2.1.0.orig//stk11xx-v4l.c stk11xx-2.1.0/stk11xx-v4l.c
--- stk11xx-2.1.0.orig//stk11xx-v4l.c 2009-05-08 12:24:08.000000000 +0200
+++ stk11xx-2.1.0/stk11xx-v4l.c 2011-04-20 17:10:43.953325918 +0200
@@ -40,7 +40,6 @@
#include <linux/kref.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
-#include <linux/videodev.h>
#include <linux/usb.h>
@@ -625,341 +624,6 @@
#endif
switch (cmd) {
- // Video 4 Linux v1
-
- case VIDIOCGCAP:
- {
- struct video_capability *cap = arg;
-
- STK_DEBUG("VIDIOCGCAP\n");
-
- memset(cap, 0, sizeof(*cap));
- strlcpy(cap->name, "stk11xx", sizeof(cap->name));
- cap->type = VID_TYPE_CAPTURE;
- cap->channels = 1;
- cap->audios = 0;
-
- switch (dev->webcam_type) {
- case STK11XX_SXGA:
- cap->minwidth = stk11xx_image_sizes[STK11XX_80x60].x;
- cap->minheight = stk11xx_image_sizes[STK11XX_80x60].y;
- cap->maxwidth = stk11xx_image_sizes[STK11XX_1280x1024].x;
- cap->maxheight = stk11xx_image_sizes[STK11XX_1280x1024].y;
- break;
-
- case STK11XX_VGA:
- cap->minwidth = stk11xx_image_sizes[STK11XX_80x60].x;
- cap->minheight = stk11xx_image_sizes[STK11XX_80x60].y;
- cap->maxwidth = stk11xx_image_sizes[STK11XX_640x480].x;
- cap->maxheight = stk11xx_image_sizes[STK11XX_640x480].y;
- break;
- }
- }
- break;
-
- case VIDIOCGCHAN:
- {
- struct video_channel *v = arg;
-
- STK_DEBUG("VIDIOCGCHAN\n");
-
- if (v->channel != 0)
- return -EINVAL;
-
- v->flags = 0;
- v->tuners = 0;
- v->type = VIDEO_TYPE_CAMERA;
- strcpy(v->name, "Webcam");
- }
- break;
-
- case VIDIOCSCHAN:
- {
- struct video_channel *v = arg;
-
- STK_DEBUG("VIDIOCSCHAN\n");
-
- if (v->channel != 0)
- return -EINVAL;
- }
- break;
-
- case VIDIOCGPICT:
- {
- struct video_picture *p = arg;
-
- STK_DEBUG("VIDIOCGPICT\n");
-
- p->brightness = dev->vsettings.brightness;
- p->contrast = dev->vsettings.contrast;
- p->whiteness = dev->vsettings.whiteness;
- p->colour = dev->vsettings.colour;
- p->depth = dev->vsettings.depth;
- p->palette = dev->vsettings.palette;
- p->hue = dev->vsettings.hue;
-
- switch (dev->vsettings.palette) {
- case STK11XX_PALETTE_BGR24:
- p->palette = VIDEO_PALETTE_RGB24;
- break;
-
- case STK11XX_PALETTE_BGR32:
- p->palette = VIDEO_PALETTE_RGB32;
- break;
-
- case STK11XX_PALETTE_UYVY:
- p->palette = VIDEO_PALETTE_UYVY;
- break;
-
- case STK11XX_PALETTE_YUYV:
- p->palette = VIDEO_PALETTE_YUYV;
- break;
- }
- }
- break;
-
- case VIDIOCSPICT:
- {
- struct video_picture *p = arg;
-
- STK_DEBUG("VIDIOCSPICT\n");
-
- dev->vsettings.brightness = p->brightness;
- dev->vsettings.contrast = p->contrast;
- dev->vsettings.whiteness = p->whiteness;
- dev->vsettings.colour = p->colour;
- dev->vsettings.hue = p->hue;
-
- if (p->palette && p->palette != dev->vsettings.palette) {
- switch (p->palette) {
- case VIDEO_PALETTE_RGB24:
- dev->vsettings.depth = 24;
- dev->vsettings.palette = STK11XX_PALETTE_BGR24;
- break;
-
- case VIDEO_PALETTE_RGB32:
- dev->vsettings.depth = 32;
- dev->vsettings.palette = STK11XX_PALETTE_BGR32;
- break;
-
- case VIDEO_PALETTE_UYVY:
- dev->vsettings.depth = 16;
- dev->vsettings.palette = STK11XX_PALETTE_UYVY;
- break;
-
- case VIDEO_PALETTE_YUYV:
- dev->vsettings.depth = 16;
- dev->vsettings.palette = STK11XX_PALETTE_YUYV;
- break;
-
- default:
- return -EINVAL;
- }
- }
-
- dev_stk11xx_camera_settings(dev);
-
- STK_DEBUG("VIDIOCSPICT done\n");
- }
- break;
-
- case VIDIOCGWIN:
- {
- struct video_window *vw = arg;
-
- STK_DEBUG("VIDIOCGWIN\n");
-
- vw->x = 0;
- vw->y = 0;
- vw->width = dev->view.x;
- vw->height = dev->view.y;
- vw->chromakey = 0;
- }
- break;
-
- case VIDIOCSWIN:
- {
- struct video_window *vw = arg;
-
- STK_DEBUG("VIDIOCSWIN\n");
-
- STK_DEBUG("Set x=%d, y=%d\n", vw->x, vw->y);
- STK_DEBUG("Set width=%d, height=%d\n", vw->width, vw->height);
- STK_DEBUG("Flags = %X\n", vw->flags);
-
- // Stop the video stream
- dev_stk11xx_stop_stream(dev);
-
- // ISOC and URB cleanup
- usb_stk11xx_isoc_cleanup(dev);
-
- // Switch off the camera
- dev_stk11xx_camera_off(dev);
-
- dev_stk11xx_camera_asleep(dev);
-
- // Select the new video mode
- if (v4l_stk11xx_select_video_mode(dev, vw->width, vw->height)) {
- STK_ERROR("Select video mode failed !\n");
- return -EAGAIN;
- }
-
- // Clear the buffers
- stk11xx_clear_buffers(dev);
-
- // Initialize the device
- dev_stk11xx_init_camera(dev);
- dev_stk11xx_camera_on(dev);
- dev_stk11xx_reconf_camera(dev);
-
- // ISOC and URB init
- usb_stk11xx_isoc_init(dev);
-
- // Re-start the stream
- dev_stk11xx_start_stream(dev);
-
- // Video settings
- dev_stk11xx_camera_settings(dev);
- }
- break;
-
- case VIDIOCGFBUF:
- {
- struct video_buffer *vb = arg;
-
- STK_DEBUG("VIDIOCGFBUF\n");
-
- memset(vb, 0, sizeof(*vb));
- }
- break;
-
- case VIDIOCGMBUF:
- {
- int i;
- struct video_mbuf *vm = arg;
-
- STK_DEBUG("VIDIOCGMBUF\n");
-
- memset(vm, 0, sizeof(*vm));
-
- vm->size = dev->nbuffers * dev->len_per_image;
- vm->frames = dev->nbuffers;
-
- for (i=0; i<dev->nbuffers; i++)
- vm->offsets[i] = i * dev->len_per_image;
- }
- break;
-
- case VIDIOCMCAPTURE:
- {
- struct video_mmap *vm = arg;
-
- STK_DEBUG("VIDIOCMCAPTURE format=%d\n", vm->format);
-
- if (vm->frame < 0 || vm->frame >= dev->nbuffers)
- return -EINVAL;
-
- if (vm->format) {
- switch (vm->format) {
- case VIDEO_PALETTE_RGB32:
- break;
-
- case VIDEO_PALETTE_RGB24:
- break;
-
- case VIDEO_PALETTE_UYVY:
- break;
-
- case VIDEO_PALETTE_YUYV:
- break;
-
- default:
- return -EINVAL;
- }
- }
-
- if ((vm->width != dev->view.x) || (vm->height != dev->view.y))
- return -EAGAIN;
-
- if (dev->image_used[vm->frame])
- return -EBUSY;
-
- dev->image_used[vm->frame] = 1;
-
- STK_DEBUG("VIDIOCMCAPTURE done\n");
- }
- break;
-
- case VIDIOCSYNC:
- {
- int ret;
- int *mbuf = arg;
-
- STK_DEBUG("VIDIOCSYNC\n");
-
- if (*mbuf < 0 || *mbuf >= dev->nbuffers)
- return -EINVAL;
-
- if (dev->image_used[*mbuf] == 0)
- return -EINVAL;
-
- add_wait_queue(&dev->wait_frame, &wait);
-
- while (dev->full_frames == NULL) {
- if (dev->error_status) {
- remove_wait_queue(&dev->wait_frame, &wait);
- set_current_state(TASK_RUNNING);
- return -dev->error_status;
- }
-
- if (signal_pending(current)) {
- remove_wait_queue(&dev->wait_frame, &wait);
- set_current_state(TASK_RUNNING);
- return -ERESTARTSYS;
- }
-
- schedule();
- set_current_state(TASK_INTERRUPTIBLE);
- }
-
- remove_wait_queue(&dev->wait_frame, &wait);
- set_current_state(TASK_RUNNING);
-
- STK_DEBUG("VIDIOCSYNC: frame ready\n");
-
- dev->fill_image = *mbuf;
-
- ret = stk11xx_handle_frame(dev);
-
- if (ret != 0)
- STK_ERROR("VIDIOCSYNC error !\n");
-
- dev->image_used[*mbuf] = 0;
- }
- break;
-
- case VIDIOCGAUDIO:
- STK_DEBUG("VIDIOCGAUDIO\n");
- return -EINVAL;
- break;
-
- case VIDIOCSAUDIO:
- STK_DEBUG("VIDIOCSAUDIO\n");
- return -EINVAL;
- break;
-
- case VIDIOCGUNIT:
- {
- struct video_unit *vu = arg;
-
- vu->video = dev->vdev->minor & 0x3f;
- vu->audio = -1;
- vu->vbi = -1;
- vu->radio = -1;
- vu->teletext = -1;
- }
- break;
-
// Video 4 Linux v2

145
stk11xx.spec Normal file
View File

@ -0,0 +1,145 @@
# openmamba 2.6 kernel module specfile
# Copyright (C) 2004-2010 by Silvan Calarco
#
# To build for a specific target:
#
# rpm -ba --define="KERNEL_TARGET mamba" stk11xx.spec
#
# default is "mamba"
#
%define kernel_ver %{version}
%define build_version %{kernel_ver}
%define BUILD_CC %{_target_platform}-gcc
%define BUILD_CXX %{_target_platform}-g++
%if "%{?KERNEL_TARGET}" == ""
# build a mamba kernel by default
%define KERNEL_TARGET mamba
%endif
%if "%{?KERNEL_VER}" == ""
%define KERNEL_VER %(uname -r | sed "s|\\([0-9.]*\\).*|\\1|" )
%endif
Name: stk11xx
Version: 2.1.0
Release: 12mamba
Summary: Syntek Semicon DC-1125 Driver
Group: System/Kernel and Hardware/Drivers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://syntekdriver.sourceforge.net
Source: http://downloads.sourceforge.net/sourceforge/syntekdriver/stk11xx-%{version}.tar.gz
Patch0: %{name}-2.1.0-kernel-2.6.37.patch
Patch1: %{name}-2.1.0-kernel-2.6.38.patch
License: GPL
BuildRequires: ctags
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Linux/Unix driver development for Syntek Semicon USB2.0 Video device DC-1125, like the one that is found in Asus A6K laptops. The device can be recognized by the usb id 174f:a311 and maybe also be a standalone unit (not integrated).
%package -n kernel-%{KERNEL_TARGET}-stk11xx
Summary: Syntek Semicon DC-1125 Driver
Group: System/Kernel and Hardware/Drivers
Requires(pre): kernel-%{KERNEL_TARGET} >= %{KERNEL_VER}
Requires(pre): kernel-%{KERNEL_TARGET} <= %{KERNEL_VER}.255
## KERNELOBSOLETES-BEGIN 3.4
Obsoletes: kernel-%{KERNEL_TARGET}-stk11xx = 2.1.0-9mamba
Obsoletes: kernel-%{KERNEL_TARGET}-stk11xx = 2.1.0-10mamba
## KERNELOBSOLETES-END
%description -n kernel-%{KERNEL_TARGET}-stk11xx
Linux/Unix driver development for Syntek Semicon USB2.0 Video device DC-1125, like the one that is found in Asus A6K laptops. The device can be recognized by the usb id 174f:a311 and maybe also be a standalone unit (not integrated).
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%if "%{?KERNEL_TARGET}" == ""
echo "No target specified, aborting."
exit 1
%else
echo "I'm going to build module for a %{KERNEL_TARGET} kernel..."
%endif
%build
#
# build for KERNEL_TARGET
#
BUILD_OPTS="CC=%{BUILD_CC} CXX=%{BUILD_CXX} %{_smp_mflags}"
make CROSS_COMPILE=%{_target_platform}- -f Makefile.standalone clean \
KVER=%{KERNEL_VER}%{?KERNEL_TARGET} \
KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET}
make CROSS_COMPILE=%{_target_platform}- -f Makefile.standalone driver \
${BUILD_OPTS} \
KVER=%{KERNEL_VER}%{?KERNEL_TARGET} \
KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET}
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -D -m 0644 stk11xx.ko \
%{buildroot}/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/kernel/drivers/usb/media/stk11xx.ko
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n kernel-%{KERNEL_TARGET}-stk11xx
# new install or upgrade
mv /lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/net/atl1e/atl1e.ko \
/sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
%{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
:
%postun -n kernel-%{KERNEL_TARGET}-stk11xx
# erase this package
[ $1 -eq 0 ] &&
/sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
%{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
:
%files -n kernel-%{KERNEL_TARGET}-stk11xx
%defattr(-,root,root)
/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/kernel/drivers/usb/media/stk11xx.ko
#%doc copying readme
%changelog
* Sun Sep 15 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-12mamba
- kernel 3.10 rebuild
* Fri Jan 04 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-11mamba
- kernel 3.4 rebuild
* Mon Nov 05 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-10mamba
- bump release up for milestone2 update
* Sat Oct 27 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-9mamba
- kernel 3.6 rebuild
* Sat Jun 30 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-8mamba
- automatic update by autodist
* Sun Feb 12 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-7mamba
- automatic update by autodist
* Wed Jan 25 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-6mamba
- automatic update by autodist
* Sun Sep 04 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-5mamba
- automatic update by autodist
* Fri Aug 19 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-4mamba
- automatic update by autodist
* Wed Apr 20 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-3mamba
- kernel 2.6.38 rebuild
* Mon Feb 07 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-2mamba
- automatic update by autodist
* Fri Dec 17 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.0-1mamba
- package created out of kernel-extramodules