Re: [patch 17/20] chardev: GPIO for PC8736x: add proper shadow-regs for pc8736x_gpio

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

 



On 13/06/06, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:

pc8736x_gpio needs a real nsc_gpio_ops.gpio_current(), (the previous
just threw a dev_warn).  This patch adds that code to read the chip's
current-pin-output-settings, then adds the initialization of the
shadow-regs to them.  (the shadow regs are there to preclude the slow
peripheral access needed otherwize)

[snip]
+static int pc8736x_gpio_current(unsigned minor)
 {
-       dev_warn(&pdev->dev, "pc8736x_gpio_current unimplemented\n");
-       return 0;
+       int port, bit;

blank line here between variables and code, please.

+       minor &= 0x1f;
+       port = minor >> 3;
+       bit = minor & 7;
+       return pc8736x_gpio_shadow[port] >> bit & 0x01;
 }


--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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