Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbbH1NKT (ORCPT ); Fri, 28 Aug 2015 09:10:19 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:39745 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752002AbbH1NKR (ORCPT ); Fri, 28 Aug 2015 09:10:17 -0400 X-AuditID: cbfee68f-f793b6d000005f66-3c-55e05db6daa1 Message-id: <55E05B97.5090705@samsung.com> Date: Fri, 28 Aug 2015 18:31:11 +0530 From: Alim Akhtar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-version: 1.0 To: Alexey Klimov Cc: linux-scsi@vger.kernel.org, Linux Kernel Mailing List , vinholikatti@gmail.com, JBottomley@odin.com, Seungwon Jeon , Kishon Vijay Abraham I Subject: Re: [PATCH 01/10] phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC References: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> <1440149281-26336-2-git-send-email-alim.akhtar@samsung.com> In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsWyRsSkSndb7INQg/vbDCz+r7/NYnHhaQ+b xanzD1ksLu+aw2bRfX0Hm8WH+xeZLXYsrHJg99g56y67x+EfP5g9+rasYvQ4fmM7k8fnTXIB rFFcNimpOZllqUX6dglcGRM7p7AVbNWpON20n7WBcaZSFyMnh4SAicTdCdNYIGwxiQv31rN1 MXJxCAmsYJRYd+0EexcjB1jRx3VcEPFZjBJLv19lh3AeMEo83nCZEaSbV0BLYs6emewgNouA qsTEyVuZQWw2AW2Ju9O3MIEMEhWIkHh8QQiiXFDix+R7YItFgFonv9oFNpNZ4CajxIyFx9hA 6oUFfCUOz3eH2HWGUeJR03uwXZwCwRI7/59gArGZBcwkHrWsY4aw5SU2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SINyWxsiq1KD++qDQntfgQoykwECYy S4km5wOTTl5JvKGxibmpsamliYWJmaWSOK/shs2hQgLpiSWp2ampBalFMH1MHJxSDYybXRsf 9uReM1CeEOurcji3cNKZwoX+bWUnN8oVF92PuSkUuHzaGYnfJ36tCZTmCvVM5z65TP7F2z3V M96JhXvNeDjvnH2D27MZDzTCbW7Wcf8W3xmxK/HL2p69Wc5n/Tavaw/vrOdKXf747ov2pJ2n wjZviPcssDYJFdqks/GTjdOxU+1fbByVWIozEg21mIuKEwGSLiGLAgMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5785 Lines: 150 HI Alexey, Thanks for review. I will address your comments in v2 of this patch. On 08/24/2015 04:15 AM, Alexey Klimov wrote: > Hi Alim, > > On Fri, Aug 21, 2015 at 12:27 PM, Alim Akhtar wrote: >> From: Seungwon Jeon >> >> This patch introduces Exynos UFS PHY driver. This driver >> supports to deal with phy calibration and power control >> according to UFS host driver's behavior. >> >> Signed-off-by: Seungwon Jeon >> Signed-off-by: Alim Akhtar >> Cc: Kishon Vijay Abraham I >> --- >> .../devicetree/bindings/phy/samsung-phy.txt | 22 ++ >> drivers/phy/Kconfig | 7 + >> drivers/phy/Makefile | 1 + >> drivers/phy/phy-exynos-ufs.c | 277 ++++++++++++++++++++ >> drivers/phy/phy-exynos-ufs.h | 73 ++++++ >> drivers/phy/phy-exynos7-ufs.h | 89 +++++++ >> include/linux/phy/phy-exynos-ufs.h | 107 ++++++++ >> 7 files changed, 576 insertions(+) >> create mode 100644 drivers/phy/phy-exynos-ufs.c >> create mode 100644 drivers/phy/phy-exynos-ufs.h >> create mode 100644 drivers/phy/phy-exynos7-ufs.h >> create mode 100644 include/linux/phy/phy-exynos-ufs.h >> >> diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt >> index 60c6f2a..1abe2c4 100644 >> --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt >> +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt >> @@ -174,3 +174,25 @@ Example: >> usbdrdphy0 = &usb3_phy0; >> usbdrdphy1 = &usb3_phy1; >> }; >> + >> +Samsung Exynos7 soc serise UFS PHY Controller >> +--------------------------------------------- >> + >> +UFS PHY nodes are defined to describe on-chip UFS Physical layer controllers. >> +Each UFS PHY controller should have its own node. >> + >> +Required properties: >> +- compatible : compatible list, contains "samsung,exynos7-ufs-phy" >> +- reg : offset and length of the UFS PHY register set; >> +- reg-names : reg name(s) must be 'phy-pma'; >> +- #phy-cells : must be zero >> +- samsung,syscon-phandle : a phandle to the PMU system controller, no arguments >> + >> +Example: >> + ufs_phy: ufs-phy@0x15571800 { >> + compatible = "samsung,exynos7-ufs-phy"; >> + reg = <0x15571800 0x240>; >> + reg-names = "phy-pma"; >> + samsung,syscon-phandle = <&pmu_system_controller>; >> + #phy-cells = <0>; >> + }; >> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig >> index 6b8dd16..7449376 100644 >> --- a/drivers/phy/Kconfig >> +++ b/drivers/phy/Kconfig >> @@ -358,4 +358,11 @@ config PHY_BRCMSTB_SATA >> Enable this to support the SATA3 PHY on 28nm Broadcom STB SoCs. >> Likely useful only with CONFIG_SATA_BRCMSTB enabled. >> >> +config PHY_EXYNOS_UFS >> + tristate "EXYNOS SoC series UFS PHY driver" >> + depends on OF && ARCH_EXYNOS >> + select GENERIC_PHY >> + help >> + Support for UFS PHY on Samsung EXYNOS chipsets. >> + >> endmenu >> diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile >> index f344e1b..7a36818 100644 >> --- a/drivers/phy/Makefile >> +++ b/drivers/phy/Makefile >> @@ -45,3 +45,4 @@ obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-14nm.o >> obj-$(CONFIG_PHY_TUSB1210) += phy-tusb1210.o >> obj-$(CONFIG_PHY_BRCMSTB_SATA) += phy-brcmstb-sata.o >> obj-$(CONFIG_PHY_PISTACHIO_USB) += phy-pistachio-usb.o >> +obj-$(CONFIG_PHY_EXYNOS_UFS) += phy-exynos-ufs.o >> diff --git a/drivers/phy/phy-exynos-ufs.c b/drivers/phy/phy-exynos-ufs.c >> new file mode 100644 >> index 0000000..840375d >> --- /dev/null >> +++ b/drivers/phy/phy-exynos-ufs.c >> @@ -0,0 +1,277 @@ >> +/* >> + * UFS PHY driver for Samsung EXYNOS SoC >> + * >> + * Copyright (C) 2015 Samsung Electronics Co., Ltd. >> + * Author: Seungwon Jeon >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License as published by >> + * the Free Software Foundation; either version 2 of the License, or >> + * (at your option) any later version. >> + */ >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include > > What do you think about sorting this? > > >> +#include "phy-exynos-ufs.h" >> + >> +#define for_each_phy_lane(phy, i) \ >> + for (i = 0; i < (phy)->lane_cnt; i++) >> +#define for_each_phy_cfg(cfg) \ >> + for (; (cfg)->id; (cfg)++) >> + >> +#define phy_pma_writel(phy, val, reg) \ >> + writel((val), (phy)->reg_pma + (reg)) >> +#define phy_pma_readl(phy, reg) \ >> + readl((phy)->reg_pma + (reg)) >> + >> +#define PHY_DEF_LANE_CNT 1 >> + >> +static inline struct exynos_ufs_phy *get_exynos_ufs_phy(struct phy *phy) >> +{ >> + return (struct exynos_ufs_phy *)phy_get_drvdata(phy); >> +} > > Let compiler decide when to inline static function. > Please don't make static inline functions in *.c files. > > > > Thanks. > -- 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/