From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbdLDPXe (ORCPT ); Mon, 4 Dec 2017 10:23:34 -0500 Received: from foss.arm.com ([217.140.101.70]:37322 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbdLDPXd (ORCPT ); Mon, 4 Dec 2017 10:23:33 -0500 Subject: Re: polarity inversion on LS1021a To: Rasmus Villemoes , LKML Cc: Thomas Gleixner , Shawn Guo References: <67135504-72fb-ef7e-cac4-03331550a38d@prevas.dk> From: Marc Zyngier Organization: ARM Ltd Message-ID: <48d2d08c-c57a-ce49-5958-0fd5ad4a2dc7@arm.com> Date: Mon, 4 Dec 2017 15:23:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <67135504-72fb-ef7e-cac4-03331550a38d@prevas.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rasmus, On 04/12/17 15:11, Rasmus Villemoes wrote: > The LS1021A has a standard GIC-400, but allows inverting the polarity of > six external interrupt lines via a certain register, effectively > supporting IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. > > I'm trying to figure out how one would add support for this. The patch > below works but is obviously just meant to help show what I mean, so > please don't comment on all the things that are wrong with it. > > It feels wrong to create a whole new irqchip driver copy-pasting the > entire irg-gic.c, but I can't figure out how and where one could hook > into the existing one. Any pointers on how to do this properly will be > greatly appreciated. You're missing the usual trick, which is to use a stacked irqchip for these particular interrupts. See drivers/irqchip/irq-mtk-sysirq.c which does exactly that. Bonus point if you make it a generic driver that can be reused by other vendors. Your patch has been erased in order to protect the innocents ;-). Thanks, M. -- Jazz is not dead. It just smells funny...