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

R: R_PORT_G driver?



Hi Ronny,
I have modified a driver of mine adding the lines below: it works fine.

static int portg_ioctl(struct inode *inode, struct file *file, unsigned int
op, unsigned long arg)
{

 int bitnum;

 switch (op)
 {
  case PORTG_SET_GENIO_BIT:   /* Set General I/O bit */
   bitnum = (arg & 0x0000000f);
   REG_SHADOW_SET (R_PORT_G_DATA, port_g_data_shadow, bitnum, 1);
      break;

  case PORTG_RESET_GENIO_BIT:   /* Reset General I/O bit */
   bitnum = (arg & 0x0000000f);
   REG_SHADOW_SET (R_PORT_G_DATA, port_g_data_shadow, bitnum, 0);
   break;

[ cut ]


obviously I had to define PORTG_SET_GENIO_BIT and PORTG_RESET_GENIO_BIT in
the header too.


Stefano Vicenzetto

-----Messaggio Originale-----
Da: "Ronny L Nilsson" <rln@xxxxxxx.se>
A: <dev-etrax@xxxxxxx.com>
Data invio: venerd́ 26 luglio 2002 12.21
Oggetto: R_PORT_G driver?


>
> Hi
> I've been looking for a driver for the geneneral port (R_PORT_G_DATA)
> but can't find one. Shouldn't this be somehow supported by
> arch/cris/drivers/gpio.c, like it does for R_PORT_PA_DATA?
>
> Also, when doing a kernel config you can set default values of
> R_PORT_PA_DIR
> R_PORT_PB_CONFIG
> R_PORT_PB_DATA
> ...
> .. etc.
> But why can't this done for R_GEN_CONFIG and R_PORT_G_DATA?
>
>
> By
> /Ronny
>
>