From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753507AbcFTItw (ORCPT ); Mon, 20 Jun 2016 04:49:52 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37512 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbcFTItg (ORCPT ); Mon, 20 Jun 2016 04:49:36 -0400 Date: Mon, 20 Jun 2016 09:49:49 +0100 From: Lee Jones To: Bin Gao Cc: Zhang Rui , Eduardo Valentin , linux-kernel@vger.kernel.org, ysiyer , Ajay Thomas , Bin Gao , broonie@kernel.org Subject: Re: [PATCH v2] mfd: intel_soc_pmic_bxtwc: Add Intel BXT WhiskeyCove PMIC ADC thermal channel-zone mapping Message-ID: <20160620084949.GA1465@dell> References: <20160616215843.GA65542@worksta> <20160617080159.GF21702@dell> <20160620041140.GA237834@worksta> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160620041140.GA237834@worksta> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 19 Jun 2016, Bin Gao wrote: > On Fri, Jun 17, 2016 at 09:01:59AM +0100, Lee Jones wrote: > > > +static struct trip_config_map str0_trip_config[] = { > > > + { > > > + .irq_reg = BXTWC_THRM0IRQ, > > > + .irq_mask = 0x01, > > > + .irq_en = BXTWC_MTHRM0IRQ, > > > + .irq_en_mask = 0x01, > > > + .evt_stat = BXTWC_STHRM0IRQ, > > > + .evt_mask = 0x01, > > > + .trip_num = 0 > > > + }, > > > + { > > > + .irq_reg = BXTWC_THRM0IRQ, > > > + .irq_mask = 0x10, > > > + .irq_en = BXTWC_MTHRM0IRQ, > > > + .irq_en_mask = 0x10, > > > + .evt_stat = BXTWC_STHRM0IRQ, > > > + .evt_mask = 0x10, > > > + .trip_num = 1 > > > + } > > > +}; > > > + > > > +static struct trip_config_map str1_trip_config[] = { > > > + { > > > + .irq_reg = BXTWC_THRM0IRQ, > > > + .irq_mask = 0x02, > > > + .irq_en = BXTWC_MTHRM0IRQ, > > > + .irq_en_mask = 0x02, > > > + .evt_stat = BXTWC_STHRM0IRQ, > > > + .evt_mask = 0x02, > > > + .trip_num = 0 > > > + }, > > > + { > > > + .irq_reg = BXTWC_THRM0IRQ, > > > + .irq_mask = 0x20, > > > + .irq_en = BXTWC_MTHRM0IRQ, > > > + .irq_en_mask = 0x20, > > > + .evt_stat = BXTWC_STHRM0IRQ, > > > + .evt_mask = 0x20, > > > + .trip_num = 1 > > > + }, > > > +}; > > > + > > > +static struct trip_config_map str2_trip_config[] = { > > > + { > > > + .irq_reg = BXTWC_THRM0IRQ, > > > + .irq_mask = 0x04, > > > + .irq_en = BXTWC_MTHRM0IRQ, > > > + .irq_en_mask = 0x04, > > > + .evt_stat = BXTWC_STHRM0IRQ, > > > + .evt_mask = 0x04, > > > + .trip_num = 0 > > > + }, > > > + { > > > + .irq_reg = BXTWC_THRM0IRQ, > > > + .irq_mask = 0x40, > > > + .irq_en = BXTWC_MTHRM0IRQ, > > > + .irq_en_mask = 0x40, > > > + .evt_stat = BXTWC_STHRM0IRQ, > > > + .evt_mask = 0x40, > > > + .trip_num = 1 > > > + }, > > > +}; > > > + > > > +static struct trip_config_map str3_trip_config[] = { > > > + { > > > + .irq_reg = BXTWC_THRM2IRQ, > > > + .irq_mask = 0x10, > > > + .irq_en = BXTWC_MTHRM2IRQ, > > > + .irq_en_mask = 0x10, > > > + .evt_stat = BXTWC_STHRM2IRQ, > > > + .evt_mask = 0x10, > > > + .trip_num = 0 > > > + }, > > > +}; > > > > This looks like a register map to me. > > > > Can you use the regmap framework instead? > > These are platform data used by another driver(thermal driver) which > uses regmap framework to access some of the fields of the structure( > irq_reg, irq_en and evt_stat). I suggest you create the regmap here and pass it to the thermal driver instead. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog