Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbbBFKKN (ORCPT ); Fri, 6 Feb 2015 05:10:13 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:59076 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbbBFKKL (ORCPT ); Fri, 6 Feb 2015 05:10:11 -0500 Date: Fri, 6 Feb 2015 11:10:06 +0100 From: Sascha Hauer To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, eddie.huang@mediatek.com, Lee Jones , Mark Brown Subject: Recommendations for a new MFD device driver? Message-ID: <20150206101006.GK12209@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 11:07:24 up 113 days, 21:21, 160 users, load average: 0.07, 0.09, 0.09 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1650 Lines: 40 Hi All, We are adding support for a new pretty typical MFD device, the MediaTek MT6397. Initial patches are already posted. It's a PMIC which among other things has regulators and a RTC. The same RTC is reused on another PMIC, but with another register offset and another interrupt. Now the question is where shall we put the register/irq resource information? 1) Put it into the RTC device driver. 2) Put it into the .resource field of struct mfd_cell 3) Put it into the device tree using standard reg, interrupt properties and a) Let the RTC driver interpret these b) Let the MFD driver create resources in the .resource field of struct mfd_cell c) Let the MFD core create the resources I have a tendency to 3, but I'm afraid that the resource informations are duplicated too much in the device tree source files, because every user would have to carry a full description of the mfd device. Maybe that duplication could be reduced with some CPP magic, I don't know. Maybe this is a solved problem and I'm just not picking a good example from drivers/mfd. Any thoughts? Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/