From patchwork Mon Apr 16 19:15:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Liu X-Patchwork-Id: 10343731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE82460216 for ; Mon, 16 Apr 2018 19:15:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A006F288CF for ; Mon, 16 Apr 2018 19:15:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94D07288D0; Mon, 16 Apr 2018 19:15:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 657A5288CB for ; Mon, 16 Apr 2018 19:15:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753328AbeDPTPV (ORCPT ); Mon, 16 Apr 2018 15:15:21 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:41115 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753233AbeDPTPM (ORCPT ); Mon, 16 Apr 2018 15:15:12 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3GJFBXL013270 for ; Mon, 16 Apr 2018 14:15:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523906112; bh=JzxQlHdUEBUAFS5rmt+iyLpBipl4h/n9nmndhNfLco0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=e6vpsiCl2nCcOiQnBrbBBs+HDQ8Py/M5HCh5p6xnd/bKmzzESQX7GWfImysNMKpIZ ABwkxni0N8SG/uzvtU//OPMjMLcytGXQD+5tTLPh6NvNWItj+tTeFABt+ZOcCmeiah ZBNYNJFHcaIM/F3E2UACsBk8qa34Shc4Gte6igvE= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3GJFB9u024522 for ; Mon, 16 Apr 2018 14:15:11 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 16 Apr 2018 14:15:11 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 16 Apr 2018 14:15:11 -0500 Received: from uda0271908.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3GJFBRC022795; Mon, 16 Apr 2018 14:15:11 -0500 From: Bin Liu To: CC: Bin Liu Subject: [PATCH 05/11] usb: musb: remove duplicated quirks flag Date: Mon, 16 Apr 2018 14:15:05 -0500 Message-ID: <1523906111-2328-6-git-send-email-b-liu@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523906111-2328-1-git-send-email-b-liu@ti.com> References: <1523906111-2328-1-git-send-email-b-liu@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both musb_io and musb_platform_ops in struct musb define a quirks flag for the same purpose. Let's remove the one in struct musb_io, and use that in struct musb_platform_ops instead. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.c | 10 ++++------ drivers/usb/musb/musb_cppi41.c | 4 ++-- drivers/usb/musb/musb_dma.h | 10 +++++----- drivers/usb/musb/musb_io.h | 2 -- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index d3f9f7e5f353..84f25a2b078d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1493,7 +1493,7 @@ static int musb_core_init(u16 musb_type, struct musb *musb) hw_ep->fifo = musb->io.fifo_offset(i) + mbase; #if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010) - if (musb->io.quirks & MUSB_IN_TUSB) { + if (musb->ops->quirks & MUSB_IN_TUSB) { hw_ep->fifo_async = musb->async + 0x400 + musb->io.fifo_offset(i); hw_ep->fifo_sync = musb->sync + 0x400 + @@ -2176,11 +2176,9 @@ static void musb_deassert_reset(struct work_struct *work) goto fail2; } - if (musb->ops->quirks) - musb->io.quirks = musb->ops->quirks; /* Most devices use indexed offset or flat offset */ - if (musb->io.quirks & MUSB_INDEXED_EP) { + if (musb->ops->quirks & MUSB_INDEXED_EP) { musb->io.ep_offset = musb_indexed_ep_offset; musb->io.ep_select = musb_indexed_ep_select; } else { @@ -2188,7 +2186,7 @@ static void musb_deassert_reset(struct work_struct *work) musb->io.ep_select = musb_flat_ep_select; } - if (musb->io.quirks & MUSB_G_NO_SKB_RESERVE) + if (musb->ops->quirks & MUSB_G_NO_SKB_RESERVE) musb->g.quirk_avoids_skb_reserve = 1; /* At least tusb6010 has its own offsets */ @@ -2647,7 +2645,7 @@ static int musb_suspend(struct device *dev) ; musb->flush_irq_work = false; - if (!(musb->io.quirks & MUSB_PRESERVE_SESSION)) + if (!(musb->ops->quirks & MUSB_PRESERVE_SESSION)) musb_writeb(musb->mregs, MUSB_DEVCTL, 0); WARN_ON(!list_empty(&musb->pending_list)); diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index d0dd4f470bbe..7fbb8a307145 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -614,7 +614,7 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) } /* DA8xx Advisory 2.3.27: wait 250 ms before to start the teardown */ - if (musb->io.quirks & MUSB_DA8XX) + if (musb->ops->quirks & MUSB_DA8XX) mdelay(250); tdbit = 1 << cppi41_channel->port_num; @@ -773,7 +773,7 @@ struct dma_controller * controller->controller.is_compatible = cppi41_is_compatible; controller->controller.musb = musb; - if (musb->io.quirks & MUSB_DA8XX) { + if (musb->ops->quirks & MUSB_DA8XX) { controller->tdown_reg = DA8XX_USB_TEARDOWN; controller->autoreq_reg = DA8XX_USB_AUTOREQ; controller->set_dma_mode = da8xx_set_dma_mode; diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h index 0fc8cd0c2a5c..8f60271c0a9d 100644 --- a/drivers/usb/musb/musb_dma.h +++ b/drivers/usb/musb/musb_dma.h @@ -44,31 +44,31 @@ #endif #ifdef CONFIG_USB_UX500_DMA -#define musb_dma_ux500(musb) (musb->io.quirks & MUSB_DMA_UX500) +#define musb_dma_ux500(musb) (musb->ops->quirks & MUSB_DMA_UX500) #else #define musb_dma_ux500(musb) 0 #endif #ifdef CONFIG_USB_TI_CPPI41_DMA -#define musb_dma_cppi41(musb) (musb->io.quirks & MUSB_DMA_CPPI41) +#define musb_dma_cppi41(musb) (musb->ops->quirks & MUSB_DMA_CPPI41) #else #define musb_dma_cppi41(musb) 0 #endif #ifdef CONFIG_USB_TI_CPPI_DMA -#define musb_dma_cppi(musb) (musb->io.quirks & MUSB_DMA_CPPI) +#define musb_dma_cppi(musb) (musb->ops->quirks & MUSB_DMA_CPPI) #else #define musb_dma_cppi(musb) 0 #endif #ifdef CONFIG_USB_TUSB_OMAP_DMA -#define tusb_dma_omap(musb) (musb->io.quirks & MUSB_DMA_TUSB_OMAP) +#define tusb_dma_omap(musb) (musb->ops->quirks & MUSB_DMA_TUSB_OMAP) #else #define tusb_dma_omap(musb) 0 #endif #ifdef CONFIG_USB_INVENTRA_DMA -#define musb_dma_inventra(musb) (musb->io.quirks & MUSB_DMA_INVENTRA) +#define musb_dma_inventra(musb) (musb->ops->quirks & MUSB_DMA_INVENTRA) #else #define musb_dma_inventra(musb) 0 #endif diff --git a/drivers/usb/musb/musb_io.h b/drivers/usb/musb/musb_io.h index b4d870b836aa..8058a58092cf 100644 --- a/drivers/usb/musb/musb_io.h +++ b/drivers/usb/musb/musb_io.h @@ -16,7 +16,6 @@ /** * struct musb_io - IO functions for MUSB - * @quirks: platform specific flags * @ep_offset: platform specific function to get end point offset * @ep_select: platform specific function to select end point * @fifo_offset: platform specific function to get fifo offset @@ -25,7 +24,6 @@ * @busctl_offset: platform specific function to get busctl offset */ struct musb_io { - u32 quirks; u32 (*ep_offset)(u8 epnum, u16 offset); void (*ep_select)(void __iomem *mbase, u8 epnum); u32 (*fifo_offset)(u8 epnum);