Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932434AbdHVJu5 (ORCPT ); Tue, 22 Aug 2017 05:50:57 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:36908 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932306AbdHVJuz (ORCPT ); Tue, 22 Aug 2017 05:50:55 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Andy Shevchenko Date: Tue, 22 Aug 2017 12:50:54 +0300 Message-ID: Subject: Re: [RFC v1 4/6] platform: x86: Add generic Intel IPC driver To: sathya Cc: Kuppuswamy Sathyanarayanan , "x86@kernel.org" , Ingo Molnar , Zha Qipeng , "H. Peter Anvin" , "dvhart@infradead.org" , Thomas Gleixner , Andy Shevchenko , "linux-kernel@vger.kernel.org" , Platform Driver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 43 On Tue, Aug 22, 2017 at 8:09 AM, sathya wrote: > On 08/18/2017 05:38 AM, Andy Shevchenko wrote: >> On Tue, Aug 1, 2017 at 9:13 PM, >> wrote: >>> +struct intel_ipc_dev_cfg { >>> + void __iomem *base; >>> + void __iomem *wrbuf_reg; >>> + void __iomem *rbuf_reg; >>> + void __iomem *sptr_reg; >>> + void __iomem *dptr_reg; >>> + void __iomem *status_reg; >>> + void __iomem *cmd_reg; >> >> No, you have to switch to regmap instead. > > Do you want me to register regmap in intel_pmc_ipc.c and pass this regmap > pointer to devm_intel_ipc_dev_create() > instead of regular mem address ? Please correct me if my understanding is > incorrect. > > But I don't understand how this change will improve the design. We will have a core part which takes a PMC/SCU regmap on input. Core part will not know about exact PMC in use. On top of core part you will have one driver per PMC type. In exchange core part will provide a generic set of functions like "send simple command", "send command", "do ...smth...". Core part _is_ a library. >>> + int mode; >>> + int irq; >>> + int irqflags; >>> + int chan_type; >>> + bool use_msi; >>> +}; -- With Best Regards, Andy Shevchenko