From: Stephen Warren Date: Fri, 2 Dec 2011 22:08:40 +0000 (-0700) Subject: ASoC: WM8903: Get default irq_active_low from IRQ controller X-Git-Tag: v3.3-rc1~14^2~183 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d35f3e100eb5cfb91d777c8621fb585ad0327cd;p=pandora-kernel.git ASoC: WM8903: Get default irq_active_low from IRQ controller If the WM8903 is hooked up to an interrupt, set the irq_active_low flag in the default platform data based on the IRQ's IRQ_TYPE. Map IRQ_TYPE_NONE (a lack of explicit configuration/restriction) to irq_active_low = false; the previous default. This code is mainly added to support device tree interrupt bindings, although will work perfectly well in a non device tree system too. Any interrupt controller that supports only a single IRQ_TYPE could set each IRQ's type based on that restriction. This applies equally with and without device tree. To cater for interrupt controllers that don't do this, for which irqd_get_trigger_type() will return IRQ_TYPE_NONE, the platform data irq_active_low field may be used in systems that don't use device tree. With device tree, every IRQ must have some IRQ_TYPE set. Controllers that support DT and multiple IRQ_TYPEs must define the interrupts property (as used in interrupt source nodes) such that it defines the IRQ_TYPE to use. When the core DT setup code initializes wm8903->irq, the interrupts property will be parsed, and as a side- effect, set the IRQ's IRQ_TYPE for the WM8903 probe() function to read. Controllers that support DT and a single IRQ_TYPE could arrange to set the IRQ_TYPE somehow during their initialization, or hard-code it during the processing of the child interrupts property. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- Reading git-diff-tree failed