Writing to parallel port register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am trying parallel port module in the LDD3 book, I have soldered the circuit as said in the book and test it with userspace application, the circuit is working fine so no hardware side problem.

But when I try to wirte in parllel port register at address 0x378 it is not toggling the leds as given in the ldd book. Im not using the same ldd example. modified it to be simple. code is below.

// requesting the region in the module init section

	if(!request_region(base, 8, "par")) {
		printk(KERN_INFO "par: err while request_region()\n");
		return -ENODEV;
	}


// in the open callback func I am trying to toggle the leds

int par_open(struct inode *node, struct file *fp)
{
	static int tog = 0;
	static unsigned char data = 0;
	unsigned long port = base + (par_minor&0x0f);

printk(KERN_INFO "par: device opened, tog = %d, data = %x\n", tog,data);

	if (tog) {
		outb(data, port);
		wmb();
	} else {
		outb(data, port);
		wmb();
	}

	tog ^= 1;
	data ^= 0xff;

	return 0;
}


Any idea where I really did mistake.

Regards,
Mohamed Thalib H


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux