{"id":291900,"url":"http://patchwork.ozlabs.org/api/patches/291900/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1384729577-7336-10-git-send-email-gsi@denx.de/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<1384729577-7336-10-git-send-email-gsi@denx.de>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/1384729577-7336-10-git-send-email-gsi@denx.de/","date":"2013-11-17T23:06:09","name":"[v5,09/17] serial: mpc512x: adjust for OF based clock lookup","commit_ref":"e149b42b8605f4e0e86662fe880716ccdfdb4ef9","pull_url":null,"state":"accepted","archived":true,"hash":"95ad862e4200ae3f2e3752630a37cbc4a31e4046","submitter":{"id":25825,"url":"http://patchwork.ozlabs.org/api/people/25825/?format=json","name":"Gerhard Sittig","email":"gsi@denx.de"},"delegate":{"id":1700,"url":"http://patchwork.ozlabs.org/api/users/1700/?format=json","username":"ag","first_name":"Anatolij","last_name":"Gustschin","email":"agust@denx.de"},"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1384729577-7336-10-git-send-email-gsi@denx.de/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/291900/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/291900/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Received":["from ozlabs.org (localhost [IPv6:::1])\n\tby ozlabs.org (Postfix) with ESMTP id 937892C0D6D\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 18 Nov 2013 10:13:12 +1100 (EST)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id EACC72C0540\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon, 18 Nov 2013 10:08:15 +1100 (EST)","from frontend1.mail.m-online.net\n\t(frontend1.mail.intern.m-online.net [192.168.8.180])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3dN89863dgz3hhkN;\n\tMon, 18 Nov 2013 00:08:12 +0100 (CET)","from localhost (dynscan1.mnet-online.de [192.168.6.68])\n\tby mail.m-online.net (Postfix) with ESMTP id 3dN8985WRGzbbg3;\n\tMon, 18 Nov 2013 00:08:12 +0100 (CET)","from mail.mnet-online.de ([192.168.8.180])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id xizPGSp-bkHO; Mon, 18 Nov 2013 00:08:08 +0100 (CET)","from localhost (host-82-135-33-74.customer.m-online.net\n\t[82.135.33.74]) by mail.mnet-online.de (Postfix) with ESMTPA;\n\tMon, 18 Nov 2013 00:08:08 +0100 (CET)"],"X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"/01pP+ikMPalPR8sRJg3wKHGa7zA4FCjNDZ4XODw2RM=","From":"Gerhard Sittig <gsi@denx.de>","To":"linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,\n\tAnatolij Gustschin <agust@denx.de>,\n\tMike Turquette <mturquette@linaro.org>","Subject":"[PATCH v5 09/17] serial: mpc512x: adjust for OF based clock lookup","Date":"Mon, 18 Nov 2013 00:06:09 +0100","Message-Id":"<1384729577-7336-10-git-send-email-gsi@denx.de>","X-Mailer":"git-send-email 1.7.10.4","In-Reply-To":"<1384729577-7336-1-git-send-email-gsi@denx.de>","References":"<1384729577-7336-1-git-send-email-gsi@denx.de>","Cc":"Detlev Zundel <dzu@denx.de>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tGerhard Sittig <gsi@denx.de>, \n\tlinux-serial@vger.kernel.org, Scott Wood <scottwood@freescale.com>,\n\tJiri Slaby <jslaby@suse.cz>","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.16rc2","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"after device tree based clock lookup became available, the peripheral\ndriver need no longer construct clock names which include the PSC index,\nremove the \"psc%d_mclk\" template and unconditionally use 'mclk'\n\nacquire and release the \"ipg\" clock item for register access as well\n\nCc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\nCc: Jiri Slaby <jslaby@suse.cz>\nCc: linux-serial@vger.kernel.org\nAcked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # for v4\nSigned-off-by: Gerhard Sittig <gsi@denx.de>\n---\nGreg, the difference between v4 and v5 of this patch is that v4\ntook the 'mclk' and 'ipg' clock items in reverse order, and thus\npotentially obfuscated the adjusted name for 'mclk' -- v5 of the\npatch is identical in content but cleaner diff-wise\n\n---\n drivers/tty/serial/mpc52xx_uart.c |   40 ++++++++++++++++++++++++++++++++-----\n 1 file changed, 35 insertions(+), 5 deletions(-)","diff":"diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c\nindex 5be1df39f9f5..1d1dbe9d5af2 100644\n--- a/drivers/tty/serial/mpc52xx_uart.c\n+++ b/drivers/tty/serial/mpc52xx_uart.c\n@@ -619,29 +619,55 @@ static irqreturn_t mpc512x_psc_handle_irq(struct uart_port *port)\n }\n \n static struct clk *psc_mclk_clk[MPC52xx_PSC_MAXNUM];\n+static struct clk *psc_ipg_clk[MPC52xx_PSC_MAXNUM];\n \n /* called from within the .request_port() callback (allocation) */\n static int mpc512x_psc_alloc_clock(struct uart_port *port)\n {\n \tint psc_num;\n-\tchar clk_name[16];\n \tstruct clk *clk;\n \tint err;\n \n \tpsc_num = (port->mapbase & 0xf00) >> 8;\n-\tsnprintf(clk_name, sizeof(clk_name), \"psc%d_mclk\", psc_num);\n-\tclk = devm_clk_get(port->dev, clk_name);\n+\n+\tclk = devm_clk_get(port->dev, \"mclk\");\n \tif (IS_ERR(clk)) {\n \t\tdev_err(port->dev, \"Failed to get MCLK!\\n\");\n-\t\treturn PTR_ERR(clk);\n+\t\terr = PTR_ERR(clk);\n+\t\tgoto out_err;\n \t}\n \terr = clk_prepare_enable(clk);\n \tif (err) {\n \t\tdev_err(port->dev, \"Failed to enable MCLK!\\n\");\n-\t\treturn err;\n+\t\tgoto out_err;\n \t}\n \tpsc_mclk_clk[psc_num] = clk;\n+\n+\tclk = devm_clk_get(port->dev, \"ipg\");\n+\tif (IS_ERR(clk)) {\n+\t\tdev_err(port->dev, \"Failed to get IPG clock!\\n\");\n+\t\terr = PTR_ERR(clk);\n+\t\tgoto out_err;\n+\t}\n+\terr = clk_prepare_enable(clk);\n+\tif (err) {\n+\t\tdev_err(port->dev, \"Failed to enable IPG clock!\\n\");\n+\t\tgoto out_err;\n+\t}\n+\tpsc_ipg_clk[psc_num] = clk;\n+\n \treturn 0;\n+\n+out_err:\n+\tif (psc_mclk_clk[psc_num]) {\n+\t\tclk_disable_unprepare(psc_mclk_clk[psc_num]);\n+\t\tpsc_mclk_clk[psc_num] = NULL;\n+\t}\n+\tif (psc_ipg_clk[psc_num]) {\n+\t\tclk_disable_unprepare(psc_ipg_clk[psc_num]);\n+\t\tpsc_ipg_clk[psc_num] = NULL;\n+\t}\n+\treturn err;\n }\n \n /* called from within the .release_port() callback (release) */\n@@ -656,6 +682,10 @@ static void mpc512x_psc_relse_clock(struct uart_port *port)\n \t\tclk_disable_unprepare(clk);\n \t\tpsc_mclk_clk[psc_num] = NULL;\n \t}\n+\tif (psc_ipg_clk[psc_num]) {\n+\t\tclk_disable_unprepare(psc_ipg_clk[psc_num]);\n+\t\tpsc_ipg_clk[psc_num] = NULL;\n+\t}\n }\n \n /* implementation of the .clock() callback (enable/disable) */\n","prefixes":["v5","09/17"]}