From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753796AbbD2Pn4 (ORCPT ); Wed, 29 Apr 2015 11:43:56 -0400 Received: from mga09.intel.com ([134.134.136.24]:5944 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753602AbbD2Pny (ORCPT ); Wed, 29 Apr 2015 11:43:54 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,671,1422950400"; d="scan'208";a="702770919" Date: Wed, 29 Apr 2015 18:43:50 +0300 From: Mika Westerberg To: Lee Jones Cc: Andy Shevchenko , Andy Shevchenko , "Rafael J. Wysocki" , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Heikki Krogerus , Jarkko Nikula Subject: Re: [PATCH v1 3/3] mfd: Add support for Intel Sunrisepoint LPSS devices Message-ID: <20150429154350.GS1534@lahna.fi.intel.com> References: <1427803182-62543-1-git-send-email-andriy.shevchenko@linux.intel.com> <1427803182-62543-4-git-send-email-andriy.shevchenko@linux.intel.com> <20150429082350.GM9169@x1> <20150429150619.GW9169@x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150429150619.GW9169@x1> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2015 at 04:06:19PM +0100, Lee Jones wrote: > > >> +static const struct mfd_cell intel_lpss_uart_devs[] = { > > >> + { > > >> + .name = "dw_dmac", > > >> + .num_resources = ARRAY_SIZE(intel_lpss_idma_resources), > > >> + .resources = intel_lpss_idma_resources, > > >> + .platform_data = (void *)&intel_lpss_idma_pdata, > > >> + .pdata_size = sizeof(intel_lpss_idma_pdata), > > >> + }, > > >> + { > > >> + .name = "dw-apb-uart", > > >> + .num_resources = ARRAY_SIZE(intel_lpss_dev_resources), > > >> + .resources = intel_lpss_dev_resources, > > >> + }, > > >> +}; > > >> + > > >> +static const struct mfd_cell intel_lpss_spi_devs[] = { > > >> + { > > >> + .name = "dw_dmac", > > >> + .num_resources = ARRAY_SIZE(intel_lpss_idma_resources), > > >> + .resources = intel_lpss_idma_resources, > > >> + .platform_data = (void *)&intel_lpss_idma_pdata, > > >> + .pdata_size = sizeof(intel_lpss_idma_pdata), > > >> + }, > > >> + { > > >> + .name = "pxa2xx-spi", > > >> + .num_resources = ARRAY_SIZE(intel_lpss_dev_resources), > > >> + .resources = intel_lpss_dev_resources, > > >> + }, > > >> +}; > > >> + > > >> +static DEFINE_IDA(intel_lpss_devid_ida); > > > > > > What's wrong with using PLATFORM_DEVID_AUTO? > > > > We have to provide right clocks. > > Is it possible to use AUTO and be sure that right clocks will go to > > corresponding consumers? > > I guess Mike will have to help us with that, as I've never seen it > done this way before. > > I guess you need to create a clock driver and register it properly as > a platform device. The reason why we generate the id here is that we need a way to provide a clock with correct name to host controller and DMA drivers, and that needs to be done before those two platform devices get created. Moreover this makes it easy to match right DMA to right host controller from sysfs as they are always look like: intel-lpss.X +-> host-controller.X | +-> DMA.X X is the id we generate in the MFD driver.