Accepting request 19054 from Base:System

Copy from Base:System/lirc based on submit request 19054 from user lnussel

OBS-URL: https://build.opensuse.org/request/show/19054
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lirc?expand=0&rev=25
This commit is contained in:
OBS User autobuild 2009-08-27 17:16:58 +00:00 committed by Git OBS Bridge
parent e81f1874fc
commit 7a39ef677e
4 changed files with 193 additions and 320 deletions

View File

@ -0,0 +1,186 @@
Index: default/lirc_i2c/lirc_i2c.c
===================================================================
--- drivers.orig/lirc_i2c/lirc_i2c.c
+++ drivers/lirc_i2c/lirc_i2c.c
@@ -361,12 +361,25 @@ static struct lirc_driver lirc_template
.owner = THIS_MODULE,
};
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
static int ir_attach(struct i2c_adapter *adap, int addr,
unsigned short flags, int kind);
-static int ir_detach(struct i2c_client *client);
static int ir_probe(struct i2c_adapter *adap);
+# else
+static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id);
+#endif
+static int ir_remove(struct i2c_client *client);
static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+static const struct i2c_device_id ir_receiver_id[] = {
+ /* Generic entry for any IR receiver */
+ { "ir_video", 0 },
+ /* IR device specific entries could be added here */
+ { }
+};
+#endif
+
static struct i2c_driver driver = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
.name = "i2c ir driver",
@@ -378,34 +391,80 @@ static struct i2c_driver driver = {
},
#endif
.id = I2C_DRIVERID_EXP3, /* FIXME */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
.attach_adapter = ir_probe,
- .detach_client = ir_detach,
+ .detach_client = ir_remove,
+#else
+ .probe = ir_probe,
+ .remove = ir_remove,
+ .id_table = ir_receiver_id,
+#endif
.command = ir_command,
};
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
static struct i2c_client client_template = {
.name = "unset",
.driver = &driver
};
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
static int ir_attach(struct i2c_adapter *adap, int addr,
unsigned short flags, int kind)
+#else
+static void pcf_probe(struct i2c_client *client, struct IR *ir)
+{
+ int ret1, ret2, ret3, ret4;
+
+ ret1 = i2c_smbus_write_byte(client, 0xff);
+ ret2 = i2c_smbus_read_byte(client);
+ ret3 = i2c_smbus_write_byte(client, 0x00);
+ ret4 = i2c_smbus_read_byte(client);
+
+ /* in the Asus TV-Box: bit 1-0 */
+ if (((ret2 & 0x03) == 0x03) && ((ret4 & 0x03) == 0x00)) {
+ ir->bits = (unsigned char) ~0x07;
+ ir->flag = 0x04;
+ /* in the Creative/VisionTek BreakOut-Box: bit 7-6 */
+ } else if (((ret2 & 0xc0) == 0xc0) && ((ret4 & 0xc0) == 0x00)) {
+ ir->bits = (unsigned char) ~0xe0;
+ ir->flag = 0x20;
+ }
+
+ return;
+}
+
+static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
+#endif
{
struct IR *ir;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
int err, retval;
client_template.adapter = adap;
client_template.addr = addr;
+#else
+ struct i2c_adapter *adap = client->adapter;
+ unsigned short addr = client->addr;
+ int retval;
+#endif
ir = kmalloc(sizeof(struct IR), GFP_KERNEL);
if (!ir)
return -ENOMEM;
memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
memcpy(&ir->c, &client_template, sizeof(struct i2c_client));
ir->c.adapter = adap;
ir->c.addr = addr;
i2c_set_clientdata(&ir->c, ir);
+#else
+ memcpy(&ir->c, client, sizeof(struct i2c_client));
+
+ i2c_set_clientdata(client, ir);
+#endif
ir->l.data = ir;
ir->l.minor = minor;
ir->l.sample_rate = 10;
@@ -470,11 +529,15 @@ static int ir_attach(struct i2c_adapter
break;
case 0x21:
case 0x23:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
+ ir->bits = flags & 0xff;
+ ir->flag = (flags >> 8) & 0xff;
+#else
+ pcf_probe(client, ir);
+#endif
strlcpy(ir->c.name, "TV-Box IR", I2C_NAME_SIZE);
ir->l.code_length = 8;
ir->l.add_to_buf = add_to_buf_pcf8574;
- ir->bits = flags & 0xff;
- ir->flag = (flags >> 8) & 0xff;
break;
default:
/* shouldn't happen */
@@ -485,18 +548,22 @@ static int ir_attach(struct i2c_adapter
printk(KERN_INFO "lirc_i2c: chip 0x%x found @ 0x%02x (%s)\n",
adap->id, addr, ir->c.name);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
/* register device */
err = i2c_attach_client(&ir->c);
if (err) {
kfree(ir);
return err;
}
+#endif
retval = lirc_register_driver(&ir->l);
if (retval < 0) {
printk(KERN_ERR "lirc_i2c: failed to register driver!\n");
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
i2c_detach_client(&ir->c);
+#endif
kfree(ir);
return retval;
}
@@ -506,19 +573,22 @@ static int ir_attach(struct i2c_adapter
return 0;
}
-static int ir_detach(struct i2c_client *client)
+static int ir_remove(struct i2c_client *client)
{
struct IR *ir = i2c_get_clientdata(client);
/* unregister device */
lirc_unregister_driver(ir->l.minor);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
i2c_detach_client(&ir->c);
+#endif
/* free memory */
kfree(ir);
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
static int ir_probe(struct i2c_adapter *adap)
{
/*
@@ -656,6 +726,7 @@ attach_fail:
return rc;
}
+#endif
static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg)
{

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 27 14:30:58 UTC 2009 - lnussel@suse.de
- fix build with kernel 2.6.31
-------------------------------------------------------------------
Mon May 25 11:29:16 CEST 2009 - lnussel@suse.de

View File

@ -29,7 +29,7 @@ Release: 1
Source0: lirc-%{?snapshot}%{!?snapshot:%version}.tar.bz2
Source1: Makefile.module
Source2: Makefile.modsub
#Patch0: lirc-0.8.4pre1-kernel-2.6.27.diff
Patch0: lirc-0.8.5-kernel-2.6.31.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: s390 s390x
%suse_kernel_module_package -n lirc kdump um debug
@ -53,7 +53,7 @@ receivers for the serial port.
%prep
%setup -q -n lirc-%{?snapshot}%{!?snapshot:%version}
#patch0 -p0
%patch0 -p0
autoreconf -f -i
PYTHON=/usr/bin/python \
./configure --with-driver=all
@ -84,93 +84,3 @@ for flavor in %flavors_to_build; do
done
%changelog
* Mon May 25 2009 lnussel@suse.de
- new versio 0.8.5
* added support for Winbond 8769L CIR port (e.g. found on Acer
Aspire 6530G) (Juan J. Garcia de Soria)
* added support for FTDI FT232-based IR Receiver
* Linux input event generation using uinput
* standardised namespace following Linux input conventions
* added support for Awox RF/IR Remote (Arif)
* added support for new iMon LCD devices
* added support for Antec-branded iMon LCD and VFD devices
- imon patch no longer needed
* Mon Feb 23 2009 ro@suse.de
- fix build with current kernel
(info and warn vanished, use printk)
* Thu Nov 13 2008 lnussel@suse.de
- don't build on s390, fails all the time and doesn't make sense anyways
* Mon Oct 13 2008 lnussel@suse.de
- new version 0.8.4
* added support for ITE8709 CIR port (Gregory Lardiere)
* added pronto2lirc converter (Olavi Akerman)
* support for include directive in lircd.conf
* Mon Sep 01 2008 ro@suse.de
- pick some fixes from cvs to compile with 2.6.26
- hack to build with 2.6.27
* Mon May 05 2008 lnussel@suse.de
- new version 0.8.3
* added support for Samsung USB IR Receiver (Robert Schedel)
* added support for Soundgraph iMON IR/LCD (Dean Harding)
* added support for IRLink receiver (Maxim Muratov)
* added support for VLSystem MPlay Blast (Benoit Laurent)
* implemented SIMULATE command in irsend to simulate IR events
* added user-space I2C driver (Adam Sampson)
* added support for Hauppauge HVR-1300 (Jan Frey)
* dropped support for 2.4 kernels
* Tue Apr 29 2008 lnussel@suse.de
- add modalias supplements
- recommend lirc
* Tue Nov 27 2007 ro@suse.de
- fix build with 2.6.24
* Thu Oct 18 2007 ro@suse.de
- fix build with 2.6.23
* Fri Aug 10 2007 lnussel@suse.de
- upgrade to 0.8.2 final, just minor changes
* Fri Jun 01 2007 lnussel@suse.de
- update to 0.8.2pre3:
* added support for TechnoTrend USB IR receiver (Stefan Macher)
* automatic release event generation in lircd
* added support for Apple Mac mini USB IR Receiver (Stephen Williams)
* added support for ADSTech USBX-707 USB IR Blaster (Jelle Foks)
* periodically try to reopen lirc device if reading fails (probably
because USB device has been removed)
* added support for Creative USB IR Receiver (SB0540) (Benjamin Drung)
* lirc_mceusb2 supports setting carrier frequency
* added support for Asus DH remote (Brice DUBOST, Bernhard
Frauendienst)
* fixed show-stopper bug in RC-6 transmit code
* added support for Kanam Accent (Niccolo Rigacci)
* added support for SoundGraph iMON 2.4G DT & LT (Morten Bogeskov)
* Fri Jun 01 2007 lnussel@suse.de
- disable lirc_gpio as it doesn't build with 2.6.22
* Mon Apr 23 2007 hvogel@suse.de
- Added imon2 driver that is a copy of imon with the pad2key
patch from M. Brakemeier
* Wed Apr 04 2007 lrupp@suse.de
- added module-init-tools to BuildRequires
* Tue Feb 27 2007 ro@suse.de
- specfile: lirc-kernel-KMP should be lirc-KMP
- remove NoSource from specfile
* Mon Jan 15 2007 lnussel@suse.de
- also build xen kernel module (#233999)
* Fri Jan 12 2007 lnussel@suse.de
- fix kernel module build: SLAB_ATOMIC -> GFP_ATOMIC
* Thu Jan 11 2007 lnussel@suse.de
- new version 0.8.1
* added support for USB-UIRT
* added transmitter support for new version of Windows Media
Center transceiver
* added support for Iguanaworks USB IR Transceiver
* Mon Aug 21 2006 ro@suse.de
- fix build with 2.6.18 (from cvs)
* Thu Feb 16 2006 lnussel@suse.de
- remove redundant vermagic line from igorplugusb as it apparently
confuses some magic kernel package script
* Wed Feb 08 2006 agruen@suse.de
- Rename lirc-kernel-kmp-* to lirc-kmp-*.
* Tue Feb 07 2006 lnussel@suse.de
- serial and sir fail on ppc, skip them
- bt829, it87 and parallel fail on s390, skip them
* Thu Feb 02 2006 lnussel@suse.de
- initial kernel module package

228
lirc.spec
View File

@ -264,231 +264,3 @@ chmod 644 %{buildroot}%{_bindir}/pronto2lirc
rm -rf %{buildroot}
%changelog
* Mon May 25 2009 lnussel@suse.de
- split package to lirc, lirc-remotes, lirc-devel and liblirc_client0
* Mon May 25 2009 lnussel@suse.de
- new versio 0.8.5
* added support for Winbond 8769L CIR port (e.g. found on Acer
Aspire 6530G) (Juan J. Garcia de Soria)
* added support for FTDI FT232-based IR Receiver
* Linux input event generation using uinput
* standardised namespace following Linux input conventions
* added support for Awox RF/IR Remote (Arif)
* added support for new iMon LCD devices
* added support for Antec-branded iMon LCD and VFD devices
* Wed Jan 07 2009 olh@suse.de
- obsolete old -XXbit packages (bnc#437293)
* Thu Nov 13 2008 lnussel@suse.de
- don't BuildRequire i2c-tools on s390 as it doesn't exist there
* Mon Oct 13 2008 lnussel@suse.de
- new version 0.8.4
* added support for ITE8709 CIR port (Gregory Lardiere)
* added pronto2lirc converter (Olavi Akerman)
* support for include directive in lircd.conf
* Tue Aug 19 2008 lnussel@suse.de
- set Required-Stop in init script
* Thu Jun 26 2008 lnussel@suse.de
- fix build of hw_i2cuser on 11.0+ (bnc#387587)
* Wed May 07 2008 lnussel@suse.de
- fix build
- BuildRequire linux-kernel-headers and libusb-devel to enable
additional userspace drivers
* Mon May 05 2008 lnussel@suse.de
- new version 0.8.3
* added support for Samsung USB IR Receiver (Robert Schedel)
* added support for Soundgraph iMON IR/LCD (Dean Harding)
* added support for IRLink receiver (Maxim Muratov)
* added support for VLSystem MPlay Blast (Benoit Laurent)
* implemented SIMULATE command in irsend to simulate IR events
* added user-space I2C driver (Adam Sampson)
* added support for Hauppauge HVR-1300 (Jan Frey)
* dropped support for 2.4 kernels
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
for multilib support
* Fri Feb 22 2008 crrodriguez@suse.de
- add missing insserv_prereq
- add missing calls to restart_on_update and stop_on_removal macros
* Fri Aug 10 2007 lnussel@suse.de
- upgrade to 0.8.2 final, just minor changes
* Thu Jun 21 2007 lnussel@suse.de
- require $remote_fs in init script (#285548)
* Fri Jun 01 2007 lnussel@suse.de
- update to 0.8.2pre3:
* added support for TechnoTrend USB IR receiver (Stefan Macher)
* automatic release event generation in lircd
* added support for Apple Mac mini USB IR Receiver (Stephen Williams)
* added support for ADSTech USBX-707 USB IR Blaster (Jelle Foks)
* periodically try to reopen lirc device if reading fails (probably
because USB device has been removed)
* added support for Creative USB IR Receiver (SB0540) (Benjamin Drung)
* lirc_mceusb2 supports setting carrier frequency
* added support for Asus DH remote (Brice DUBOST, Bernhard
Frauendienst)
* fixed show-stopper bug in RC-6 transmit code
* added support for Kanam Accent (Niccolo Rigacci)
* added support for SoundGraph iMON 2.4G DT & LT (Morten Bogeskov)
* Thu May 31 2007 lnussel@suse.de
- don't install useless contrib stuff
- add proper ldconfig and insserv calls
- make initscript to automatically install
linux-input-layer-lircd.conf if lircd.conf doesn't exist and
/dev/input/ir is used as device
- add /etc/lircd.conf as %%ghost
- don't package /var/run/lirc/lircd
- don't package all remotes to save space
* Mon Apr 23 2007 hvogel@suse.de
- Add config for imon2 driver with missing keys and pad2key
addidtion from M. Brakemeier
* Tue Jan 16 2007 lnussel@suse.de
- use optflags
* Thu Jan 11 2007 lnussel@suse.de
- new version 0.8.1
* added support for USB-UIRT
* added transmitter support for new version of Windows Media
Center transceiver
* added support for Iguanaworks USB IR Transceiver
* Tue Nov 14 2006 lnussel@suse.de
- fix excessive logging in devinput driver, use syslog (#218286)
* Fri Nov 10 2006 ro@suse.de
- fix docu permissions
* Thu Aug 24 2006 lnussel@suse.de
- SYSFS{../name} is deprecated, use ATTRS{name} instead
* Thu Aug 17 2006 ro@suse.de
- fix build with 2.6.18 (from cvs)
* Tue Feb 07 2006 lnussel@suse.de
- remove CFT2000 config file as it contains a strange proprietary
notice (#148744)
* Thu Feb 02 2006 lnussel@suse.de
- update to version 0.8.0
* included kernel modules build with minor modifications (#147601)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 23 2006 ro@suse.de
- added (empty) rest of LSB init script header
* Wed Nov 30 2005 lnussel@suse.de
- use different way for matching *IR* in 51-lirc.rules to get rid of
udev.get_input_lirc.sh
* Thu Sep 01 2005 lnussel@suse.de
- move lirc related udev stuff into lirc package (#114656)
- improve checks for device presence in init script to avoid
starting an unconfigured lircd that just silently quits later.
(#106055)
- remove dependencies from initscript to allow vdr to start earlier
* Mon Aug 29 2005 lnussel@suse.de
- update input layer config file (#113852)
* Tue Aug 16 2005 lnussel@suse.de
- don't fail if evdev is not available as module (#104558)
* Wed Aug 10 2005 kraxel@suse.de
- fix quoting bug in init script (#102540).
* Tue May 31 2005 kraxel@suse.de
- fix init script (#86271).
- updfate to version 0.7.1
* Fri Mar 11 2005 lnussel@suse.de
- check if /dev/lircd is already a symlink before creating it (#71063)
- don't unload module when stopping lirc (#71063)
* Tue Mar 01 2005 kraxel@suse.de
- add compatibility symlink (bug #67039).
* Mon Jan 24 2005 kraxel@suse.de
- update to 0.7.0 final.
- move lircd sockets from /dev to /var/run/lirc (bug #44254).
* Fri Aug 20 2004 kraxel@suse.de
- update to cvs [2004-08-20]
* Tue Mar 30 2004 kraxel@suse.de
- add README.SUSE file (by lnussel)
- remove some files non-text files from documentation (bug #36349).
* Fri Mar 12 2004 kraxel@suse.de
- fix lirc start script.
* Mon Mar 08 2004 kraxel@suse.de
- update to cvs [2004-03-08]
- dropped global config file patch (merged into cvs).
* Fri Mar 05 2004 kraxel@suse.de
- update to cvs [2004-03-05]
- init script fixes.
* Mon Mar 01 2004 kraxel@suse.de
- update to cvs [2004-03-01]
- added input-layer-lircd.conf
- added global config file patch (by msvec@suse.cz).
* Thu Feb 05 2004 kraxel@suse.de
- drop km_lirc.
* Mon Jan 19 2004 kraxel@suse.de
- updated to cvs snapshot again [2004-01-16].
* Tue Oct 21 2003 kraxel@suse.de
- updated to 0.7.0 cvs snapshot.
* Thu Aug 14 2003 kraxel@suse.de
- Respect INSTALL_MOD_PATH.
* Thu Aug 14 2003 kraxel@suse.de
- added ServiceRestart to sysconfig.lirc (#28893).
* Thu Aug 14 2003 kraxel@suse.de
- fix i2c kernel module build failure.
* Fri Jun 13 2003 kukuk@suse.de
- Add missing directory to filelist
* Wed Mar 12 2003 kraxel@suse.de
- added metadata to sysconfig template [bugzilla #25077]
* Mon Mar 10 2003 kraxel@suse.de
- added init script for lircd [bugzilla #24787]
* Thu Mar 06 2003 schwab@suse.de
- Fix invalid use of floating point in kernel.
* Mon Mar 03 2003 kraxel@suse.de
- fixed module install failure (bug #24512).
* Wed Dec 11 2002 kraxel@suse.de
- splitted up the patch.
- minor specfile tweaks.
* Tue Oct 22 2002 uli@suse.de
- update -> 0.6.6 (rc tool for sending IR commands, bugfix for
Winfast TV2000 card, SIR support for Actisys Act200L dongle,
support for hardware connected to soundcard input, added support
for Tekram M230 Mach64)
* Mon Jun 03 2002 uli@suse.de
- added fix for drivers using std serial device by werner@suse.de
- touch all files to same date to avoid automake rerun
* Sun Apr 28 2002 schwab@suse.de
- Fix to build with 2.4.19-pre7.
* Fri Feb 22 2002 uli@suse.de
- removed many unnecessary files from km_lirc (fixes bug #13733)
* Mon Jan 28 2002 uli@suse.de
- update -> 0.6.5 (support for additional IR reveivers, bugfixes)
* Tue Sep 04 2001 uli@suse.de
- added remotes tarball from lirc.org containing configs for a few
hundred remote controls
* Tue Aug 21 2001 lnussel@suse.de
- new version 0.6.4 (bugfix release)
- cleaned up spec file, now uses buildroot
- added example config files for remotes to %%doc
- re-enabled parallel port driver
- changed --with-driver=none to =any to make lircd actually use
remote hardware instead of switching into network only mode
(fixes Bug #9655)
* Sat May 12 2001 schwab@suse.de
- Fix missing declarations.
* Wed May 09 2001 uli@suse.de
- building lirc_dev module in Makefile.module (reqd. by lirc_i2c)
* Thu Apr 26 2001 uli@suse.de
- fixed Makefile.module, configure call for building with
"--with-driver=none"
- disabled parport module (no go with 2.4.3)
* Thu Apr 05 2001 uli@suse.de
- kernel sources not needed any more
* Mon Mar 19 2001 uli@suse.de
- building lirc_i2c module in Makefile.module
* Mon Mar 19 2001 uli@suse.de
- update -> 0.6.3 final
- added suse_update_config before configure (fixes IA64)
- disabled useless building of drivers
- fixed building of shared libs
* Thu Feb 22 2001 uli@suse.de
- added -I/usr/src/linux/include to kernel module Makefiles
* Wed Feb 07 2001 uli@suse.de
- added lx_suse to neededforbuild
* Fri Jan 12 2001 uli@suse.de
- update -> 0.6.3pre3 (needed for kernels 2.2.18 and 2.4.0)
* Tue Oct 10 2000 ro@suse.de
- fixed oldconfig
* Mon Oct 09 2000 kukuk@suse.de
- Use default values for make oldconfig
* Fri Sep 15 2000 uli@suse.de
- fixed location of config file (/usr/etc -> /etc)
* Fri Sep 15 2000 uli@suse.de
- fixed Makefile.module
* Wed Sep 13 2000 uli@suse.de
- initial package