[PATCH 2/2] mfd: mc13xxx: Pass the IRQF_TRIGGER_HIGH flag.

Vladimir Zapolskiy vz at mleia.com
Wed Dec 21 17:08:46 PST 2016


On 12/21/2016 10:28 PM, Fabio Estevam wrote:
> On Wed, Dec 21, 2016 at 6:24 PM, Vladimir Zapolskiy <vz at mleia.com> wrote:
> 
>> Correct, I would recommend to postpone adding any extensions to the driver
>> platform data, which by the way is found in include/linux/mfd/mc13xxx.h
>>
>> The extension can be added only when it becomes needed.
> 
> Yes, I agree.
> 

So, for reference here is a snippet from the i.MX31 Lite board DTS:

&spi2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_cspi2>;

	/*
	 * Note that intentionally there is no GPIO CS, i.MX31 CSPI
	 * controller does not support GPIO CS and this must be specially
	 * accounted in the driver, which currently fails to register
	 * without a provided "cs-gpios" property.
	 */
	fsl,spi-num-chipselects = <1>;
	status = "okay";

	pmic: mc13783 at 0 {
		compatible = "fsl,mc13783";
		reg = <0>;
		spi-cs-high;
		spi-max-frequency = <1000000>;
		interrupt-parent = <&gpio1>;
		interrupts = <3 IRQ_TYPE_EDGE_RISING>;

		fsl,mc13xxx-uses-rtc;
	};
};

I'm running the current pre-rc1 v4.10. The MFD device is registered and
MC13783 primary interrupt connected to GPIO1_3 is fired as expected
independently if the fixup under discussion is applied or not:

root at mx31lite:~# dmesg | grep spi
[    2.017217] mc13xxx spi32766.0: mc13783: rev: 3.3, fin: 0, fab: 0, icid: 2/0
[    2.072029] spi_imx 50010000.cspi: probed

root at mx31lite:~# dmesg | grep rtc0
[    2.682459] mc13xxx-rtc mc13783-rtc: rtc core: registered mc13783-rtc as rtc0

root at mx31lite:~# cat /proc/interrupts | grep mc13xxx-rtc
176:          0  spi32766.0  31 Edge      mc13xxx-rtc
177:          0  spi32766.0  25 Edge      mc13xxx-rtc

root at mx31lite:~# echo +5 > /sys/class/rtc/rtc0/wakealarm ; sleep 5

root at mx31lite:~# cat /proc/interrupts | grep mc13xxx-rtc
176:          0  spi32766.0  31 Edge      mc13xxx-rtc
177:          1  spi32766.0  25 Edge      mc13xxx-rtc

So the change at least does not break i.MX31 Lite board with DTS support,
however I'm not sure if the change is still valid for any board with DTS
if the type of the interrupt is specified as IRQ_TYPE_EDGE_FALLING.

>> FWIW I ran the v4.9-rc kernel with device trees on i.MX31 Lite board
>> with MC13783, and what I can confirm is that in my case the proposed
>> change is not needed at all. Thus I'm going to verify shortly that
>> the commit does not break the currently correct runtime behaviour on
>> my board.
> 
> Nice to see imx31 with dt support :-)
> 

Basic support is done, IOMUX driver is developed, practically everything
but multimedia and USB are tested and working well, SPI driver needs
some minor special attention mentioned above, hopefully I'll find time
to submit core imx31.dtsi changes this week.

--
With best wishes,
Vladimir



More information about the linux-arm-kernel mailing list