Re: [PATCH] Add platform device support for the ISP1760 USB chip

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

 



On Tue, Feb 10, 2009 at 03:44:40PM +0000, Catalin Marinas wrote:
> On Tue, 2009-02-10 at 12:59 +0000, Russell King wrote:
> > On Tue, Feb 10, 2009 at 12:51:13PM +0000, Catalin Marinas wrote:
> > > +	hcd = isp1760_register(mem_res->start, mem_size, irq_res->start,
> > > +			       IRQF_SHARED | IRQF_DISABLED, &pdev->dev,
> > > +			       dev_name(&pdev->dev), 0);
> > 
> > Might want to pass the trigger flags as well?
> 
> The defaults were fine on my board but to make it more generic, they
> should be passed via platform_device.platform_data from the platform
> code and I would need to move the flag definitions to an include/linux/
> file. I can do this if there are no objections (or better ideas).

You normally get them from struct resource.  Notice how the IRQF_*
definitions:

/*
 * These correspond to the IORESOURCE_IRQ_* defines in
 * linux/ioport.h to select the interrupt line behaviour.  When
 * requesting an interrupt without specifying a IRQF_TRIGGER, the
 * setting should be assumed to be "as already configured", which
 * may be as per machine or firmware initialisation.
 */
#define IRQF_TRIGGER_NONE       0x00000000
#define IRQF_TRIGGER_RISING     0x00000001
#define IRQF_TRIGGER_FALLING    0x00000002
#define IRQF_TRIGGER_HIGH       0x00000004
#define IRQF_TRIGGER_LOW        0x00000008
#define IRQF_TRIGGER_MASK       (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
                                 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)

are (purposely) defined to be compatible with the resource definitions:

#define IORESOURCE_IRQ_HIGHEDGE         (1<<0)
#define IORESOURCE_IRQ_LOWEDGE          (1<<1)
#define IORESOURCE_IRQ_HIGHLEVEL        (1<<2)
#define IORESOURCE_IRQ_LOWLEVEL         (1<<3)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux