[Voyage-linux] Soekris 4801 error led control?

Muffinman (spam-protected)
Mon Jul 9 21:41:42 HKT 2012


Hello,

I have no experience with the 4801 but I do have with the 5501. It's
driver was modified by ON7LDS for the 5501 based on the 4801 driver by
Meduna/Hejl. I created a minor patch for the ON7LDS driver to update to
to kernel 2.6.38. As its package also included the original 4801 driver
I also made a patch for that one just to get rid of the compiling
errors. I haven't actually tried the 4801 driver (I don't have one, but
it did compile fine) and I haven't compiled it for the 3.x.x kernel
Voyage currently uses, but I think there is a fair chance it compiles
and works without issues. It compiles not only the error_led driver, but
also that for GPIO, Temperature- and Voltage-monitors.

It does require you to recompile the kernel without a few options:
scx200 and scx200_gpio.

I included the patch made for the ON7LDS package. While that package is
intended to add 5501 support, it also modified the common.c/h files
required for the 4801. You can request the source from ON7LDS website.
Just run the patch and follow the instructions on Meduna's website and
from ON7LDS.

Please give a post back whether you got this to work.

Kind regards, Maarten

http://www.meduna.org/sw_gpio_en.html
http://www.on7lds.net/ldsped-soekris/GPIO/index.html

On 27-06-12 11:38, sigsauer wrote:
> Hello,
>
> I'm using voyage linux 0.8.5 and I am trying to make the error led work on a
> Soekris 4801. So far as I can tell there is a kernel module present for it,
> but there is no device present in the /dev. I have tried modprobing but no
> success either. Is there any way to get this working?
>
>
> --
> View this message in context: http://voyage-linux.34677.n3.nabble.com/Soekris-4801-error-led-control-tp4025071.html
> Sent from the Voyage Linux mailing list archive at Nabble.com.
>
> _______________________________________________
> Voyage-linux mailing list
> Voyage-linux at list.voyage.hk
> http://list.voyage.hk/mailman/listinfo/voyage-linux
>


-------------- next part --------------
diff -rupN gpio-1.3.3//4801driver.c gpio-1.3.3.edit//4801driver.c
--- gpio-1.3.3//4801driver.c	2005-02-18 12:53:24.000000000 +0100
+++ gpio-1.3.3.edit//4801driver.c	2011-08-23 15:51:14.000000000 +0200
@@ -335,7 +335,7 @@ int net4801_init(struct gpio_operations
 	static unsigned base;
 	static int i;
 
-	if ((bridge = pci_find_device(SC1100_VENDOR_ID,
+	if ((bridge = pci_get_device(SC1100_VENDOR_ID,
 					SC1100_F0_DEVICE_ID ,
 					NULL)) == NULL)
 		return -ENODEV;
diff -rupN gpio-1.3.3//common.c gpio-1.3.3.edit//common.c
--- gpio-1.3.3//common.c	2010-12-13 21:08:56.000000000 +0100
+++ gpio-1.3.3.edit//common.c	2011-08-23 15:50:35.000000000 +0200
@@ -559,7 +559,7 @@ static int procfile_voltage_read(
 //------------------------------------------------
 
 
-int net4xxx_gpio_ioctl(struct inode *inode, struct file *filp,
+long net4xxx_gpio_ioctl(struct file *filp,
                 unsigned int cmd, unsigned long arg)
 {
 	int err = 0;
@@ -589,7 +589,7 @@ int net4xxx_gpio_ioctl(struct inode *ino
 	if (down_interruptible(&gpio_sema))
 		return -ERESTARTSYS;
 
-	switch(MINOR(inode->i_rdev)) {
+	switch(MINOR(filp->f_dentry->d_inode->i_rdev)) {
 		case MINOR_BYTE:        // /dev/gpio0 controls the 8 gpio ports
 		case MINOR_FULL:        // /dev/gpio1 controls the 12 gpio ports
 			switch(cmd) {
@@ -640,7 +640,7 @@ int net4xxx_gpio_ioctl(struct inode *ino
 					break;
 
 				case GPIORDDIRECTION:
-					if (MINOR(inode->i_rdev)==MINOR_BYTE) {
+					if (MINOR(filp->f_dentry->d_inode->i_rdev)==MINOR_BYTE) {
 						value = driver_ops->get8BitDirection();
 					} else {
 						value = driver_ops->get16BitDirection();
@@ -652,7 +652,7 @@ int net4xxx_gpio_ioctl(struct inode *ino
 					ret = __get_user(value, (unsigned int *)arg);
 
 					if (ret==0) {
-						if (MINOR(inode->i_rdev)==MINOR_BYTE) {
+						if (MINOR(filp->f_dentry->d_inode->i_rdev)==MINOR_BYTE) {
 							driver_ops->set8BitDirection(value);
 						} else {
 							driver_ops->set16BitDirection(value);
@@ -662,7 +662,7 @@ int net4xxx_gpio_ioctl(struct inode *ino
 					break;
 
 				case GPIORDDATA:
-					if (MINOR(inode->i_rdev)==MINOR_BYTE) {
+					if (MINOR(filp->f_dentry->d_inode->i_rdev)==MINOR_BYTE) {
 						value = driver_ops->read8Bit();
 					} else {
 						value = driver_ops->read16Bit();
@@ -675,7 +675,7 @@ int net4xxx_gpio_ioctl(struct inode *ino
 					ret = __get_user(value, (unsigned int *)arg);
 
 					if (ret==0) {
-						if (MINOR(inode->i_rdev)==MINOR_BYTE) {
+						if (MINOR(filp->f_dentry->d_inode->i_rdev)==MINOR_BYTE) {
 							driver_ops->write8Bit(value);
 						} else {
 							driver_ops->write16Bit(value);
@@ -728,7 +728,7 @@ static struct file_operations gpio_dispa
 	.read    = net4xxx_gpio_read,
 	.open    = net4xxx_gpio_open,
 	.release = net4xxx_gpio_release,
-	.ioctl   = net4xxx_gpio_ioctl,
+	.unlocked_ioctl   = net4xxx_gpio_ioctl,
 };
 
 


More information about the Voyage-linux mailing list