{"id":812751,"url":"http://patchwork.ozlabs.org/api/1.2/patches/812751/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1505210076-32311-2-git-send-email-hayashi.kunihiko@socionext.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505210076-32311-2-git-send-email-hayashi.kunihiko@socionext.com>","list_archive_url":null,"date":"2017-09-12T09:54:36","name":"[net-next,v2,2/2] net: phy: realtek: add RTL8201F phy-id and functions","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"29953c5cd3149503b18ba12e2f586a74b7211f2f","submitter":{"id":71700,"url":"http://patchwork.ozlabs.org/api/1.2/people/71700/?format=json","name":"Kunihiko Hayashi","email":"hayashi.kunihiko@socionext.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1505210076-32311-2-git-send-email-hayashi.kunihiko@socionext.com/mbox/","series":[{"id":2649,"url":"http://patchwork.ozlabs.org/api/1.2/series/2649/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=2649","date":"2017-09-12T09:54:35","name":"[net-next,v2,1/2] net: phy: realtek: rename RTL8211F_PAGE_SELECT to RTL821x_PAGE_SELECT","version":2,"mbox":"http://patchwork.ozlabs.org/series/2649/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812751/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812751/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xs0X02kfjz9s4s\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 12 Sep 2017 19:54:56 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751400AbdILJyv (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 12 Sep 2017 05:54:51 -0400","from mx.socionext.com ([202.248.49.38]:35968 \"EHLO\n\tmx.socionext.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751286AbdILJyu (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 12 Sep 2017 05:54:50 -0400","from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52])\n\tby mx.socionext.com with ESMTP; 12 Sep 2017 18:54:49 +0900","from mail.mfilter.local (unknown [10.213.24.61])\n\tby kinkan-ex.css.socionext.com (Postfix) with ESMTP id 8EB24180B90;\n\tTue, 12 Sep 2017 18:54:49 +0900 (JST)","from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP;\n\tTue, 12 Sep 2017 18:54:49 +0900","from plum.e01.socionext.com (unknown [10.213.132.32])\n\tby kinkan.css.socionext.com (Postfix) with ESMTP id EDCA61A0E11;\n\tTue, 12 Sep 2017 18:54:48 +0900 (JST)"],"From":"Kunihiko Hayashi <hayashi.kunihiko@socionext.com>","To":"Andrew Lunn <andrew@lunn.ch>,\n\tFlorian Fainelli <f.fainelli@gmail.com>, netdev@vger.kernel.org","Cc":"Jassi Brar <jaswinder.singh@linaro.org>,\n\tJongsung Kim <neidhard.kim@lge.com>,\n\tKunihiko Hayashi <hayashi.kunihiko@socionext.com>","Subject":"[PATCH net-next v2 2/2] net: phy: realtek: add RTL8201F phy-id and\n\tfunctions","Date":"Tue, 12 Sep 2017 18:54:36 +0900","Message-Id":"<1505210076-32311-2-git-send-email-hayashi.kunihiko@socionext.com>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1505210076-32311-1-git-send-email-hayashi.kunihiko@socionext.com>","References":"<1505210076-32311-1-git-send-email-hayashi.kunihiko@socionext.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Jassi Brar <jaswinder.singh@linaro.org>\n\nAdd RTL8201F phy-id and the related functions to the driver.\n\nThe original patch is as follows:\nhttps://patchwork.kernel.org/patch/2538341/\n\nSigned-off-by: Jongsung Kim <neidhard.kim@lge.com>\nSigned-off-by: Jassi Brar <jaswinder.singh@linaro.org>\nSigned-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>\nReviewed-by: Andrew Lunn <andrew@lunn.ch>\nReviewed-by: Florian Fainelli <f.fainelli@gmail.com>\n---\nChanges since v1:\n - use RTL821x_PAGE_SELECT instead of defining RTL8201F_PAGE_SELECT\n---\n drivers/net/phy/realtek.c | 44 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 44 insertions(+)","diff":"diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c\nindex 99c3297..d4670ec 100644\n--- a/drivers/net/phy/realtek.c\n+++ b/drivers/net/phy/realtek.c\n@@ -29,10 +29,22 @@\n #define RTL8211F_INSR\t\t0x1d\n #define RTL8211F_TX_DELAY\t0x100\n \n+#define RTL8201F_ISR\t\t0x1e\n+#define RTL8201F_IER\t\t0x13\n+\n MODULE_DESCRIPTION(\"Realtek PHY driver\");\n MODULE_AUTHOR(\"Johnson Leung\");\n MODULE_LICENSE(\"GPL\");\n \n+static int rtl8201_ack_interrupt(struct phy_device *phydev)\n+{\n+\tint err;\n+\n+\terr = phy_read(phydev, RTL8201F_ISR);\n+\n+\treturn (err < 0) ? err : 0;\n+}\n+\n static int rtl821x_ack_interrupt(struct phy_device *phydev)\n {\n \tint err;\n@@ -54,6 +66,25 @@ static int rtl8211f_ack_interrupt(struct phy_device *phydev)\n \treturn (err < 0) ? err : 0;\n }\n \n+static int rtl8201_config_intr(struct phy_device *phydev)\n+{\n+\tint err;\n+\n+\t/* switch to page 7 */\n+\tphy_write(phydev, RTL821x_PAGE_SELECT, 0x7);\n+\n+\tif (phydev->interrupts == PHY_INTERRUPT_ENABLED)\n+\t\terr = phy_write(phydev, RTL8201F_IER,\n+\t\t\t\tBIT(13) | BIT(12) | BIT(11));\n+\telse\n+\t\terr = phy_write(phydev, RTL8201F_IER, 0);\n+\n+\t/* restore to default page 0 */\n+\tphy_write(phydev, RTL821x_PAGE_SELECT, 0x0);\n+\n+\treturn err;\n+}\n+\n static int rtl8211b_config_intr(struct phy_device *phydev)\n {\n \tint err;\n@@ -129,6 +160,18 @@ static struct phy_driver realtek_drvs[] = {\n \t\t.config_aneg    = &genphy_config_aneg,\n \t\t.read_status    = &genphy_read_status,\n \t}, {\n+\t\t.phy_id\t\t= 0x001cc816,\n+\t\t.name\t\t= \"RTL8201F 10/100Mbps Ethernet\",\n+\t\t.phy_id_mask\t= 0x001fffff,\n+\t\t.features\t= PHY_BASIC_FEATURES,\n+\t\t.flags\t\t= PHY_HAS_INTERRUPT,\n+\t\t.config_aneg\t= &genphy_config_aneg,\n+\t\t.read_status\t= &genphy_read_status,\n+\t\t.ack_interrupt\t= &rtl8201_ack_interrupt,\n+\t\t.config_intr\t= &rtl8201_config_intr,\n+\t\t.suspend\t= genphy_suspend,\n+\t\t.resume\t\t= genphy_resume,\n+\t}, {\n \t\t.phy_id\t\t= 0x001cc912,\n \t\t.name\t\t= \"RTL8211B Gigabit Ethernet\",\n \t\t.phy_id_mask\t= 0x001fffff,\n@@ -181,6 +224,7 @@ static struct phy_driver realtek_drvs[] = {\n module_phy_driver(realtek_drvs);\n \n static struct mdio_device_id __maybe_unused realtek_tbl[] = {\n+\t{ 0x001cc816, 0x001fffff },\n \t{ 0x001cc912, 0x001fffff },\n \t{ 0x001cc914, 0x001fffff },\n \t{ 0x001cc915, 0x001fffff },\n","prefixes":["net-next","v2","2/2"]}