Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/520/?format=api
{ "id": 520, "url": "http://patchwork.ozlabs.org/api/patches/520/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080918151735.GB31187@oksana.dev.rtsoft.ru/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "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": "<20080918151735.GB31187@oksana.dev.rtsoft.ru>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20080918151735.GB31187@oksana.dev.rtsoft.ru/", "date": "2008-09-18T15:17:35", "name": "[2/3] powerpc/qe: new call to revert a gpio to a dedicated function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d25529c116b113e3b98c72ebb1ebfd93b74d4966", "submitter": { "id": 45, "url": "http://patchwork.ozlabs.org/api/people/45/?format=api", "name": "Anton Vorontsov", "email": "avorontsov@ru.mvista.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080918151735.GB31187@oksana.dev.rtsoft.ru/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/520/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/520/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Received": [ "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id 32700DE513\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 19 Sep 2008 01:18:00 +1000 (EST)", "from buildserver.ru.mvista.com (unknown [85.21.88.6])\n\tby ozlabs.org (Postfix) with ESMTP id 8CD26DE1C8\n\tfor <linuxppc-dev@ozlabs.org>; Fri, 19 Sep 2008 01:17:36 +1000 (EST)", "from localhost (unknown [10.150.0.9])\n\tby buildserver.ru.mvista.com (Postfix) with ESMTP\n\tid 11243881C; Thu, 18 Sep 2008 20:17:35 +0500 (SAMST)" ], "Date": "Thu, 18 Sep 2008 19:17:35 +0400", "From": "Anton Vorontsov <avorontsov@ru.mvista.com>", "To": "Andrew Morton <akpm@linux-foundation.org>", "Subject": "[PATCH 2/3] powerpc/qe: new call to revert a gpio to a dedicated\n\tfunction", "Message-ID": "<20080918151735.GB31187@oksana.dev.rtsoft.ru>", "References": "<20080918151659.GA20140@oksana.dev.rtsoft.ru>", "MIME-Version": "1.0", "Content-Disposition": "inline", "In-Reply-To": "<20080918151659.GA20140@oksana.dev.rtsoft.ru>", "User-Agent": "Mutt/1.5.18 (2008-05-17)", "Cc": "David Brownell <dbrownell@users.sourceforge.net>,\n\tGreg Kroah-Hartman <greg@kroah.com>, linux-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,\n\tLi Yang <leoli@freescale.com>, Timur Tabi <timur@freescale.com>", "X-BeenThere": "linuxppc-dev@ozlabs.org", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>", "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>", "List-Post": "<mailto:linuxppc-dev@ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>", "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org" }, "content": "qe_gpio_set_dedicated() is a platform specific function, which is used\nto revert a pin to a dedicated function. Caller should have already\nobtained the gpio via gpio_request().\n\nThis is needed to support Freescale USB Host Controller.\n\nSigned-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>", "diff": "diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h\nindex edee15d..c926147 100644\n--- a/arch/powerpc/include/asm/qe.h\n+++ b/arch/powerpc/include/asm/qe.h\n@@ -111,6 +111,7 @@ extern void __par_io_config_pin(struct qe_pio_regs __iomem *par_io, u8 pin,\n extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,\n \t\t\t int assignment, int has_irq);\n extern int par_io_data_set(u8 port, u8 pin, u8 val);\n+extern int qe_gpio_set_dedicated(unsigned int gpio);\n \n /* QE internal API */\n int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);\ndiff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c\nindex 8e5a0bc..bd7278f 100644\n--- a/arch/powerpc/sysdev/qe_lib/gpio.c\n+++ b/arch/powerpc/sysdev/qe_lib/gpio.c\n@@ -26,6 +26,9 @@ struct qe_gpio_chip {\n \n \t/* shadowed data register to clear/set bits safely */\n \tu32 cpdata;\n+\n+\t/* saved_regs used to restore dedicated functions */\n+\tstruct qe_pio_regs saved_regs;\n };\n \n static inline struct qe_gpio_chip *\n@@ -40,6 +43,12 @@ static void qe_gpio_save_regs(struct of_mm_gpio_chip *mm_gc)\n \tstruct qe_pio_regs __iomem *regs = mm_gc->regs;\n \n \tqe_gc->cpdata = in_be32(®s->cpdata);\n+\tqe_gc->saved_regs.cpdata = qe_gc->cpdata;\n+\tqe_gc->saved_regs.cpdir1 = in_be32(®s->cpdir1);\n+\tqe_gc->saved_regs.cpdir2 = in_be32(®s->cpdir2);\n+\tqe_gc->saved_regs.cppar1 = in_be32(®s->cppar1);\n+\tqe_gc->saved_regs.cppar2 = in_be32(®s->cppar2);\n+\tqe_gc->saved_regs.cpodr = in_be32(®s->cpodr);\n }\n \n static int qe_gpio_get(struct gpio_chip *gc, unsigned int gpio)\n@@ -103,6 +112,43 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)\n \treturn 0;\n }\n \n+int qe_gpio_set_dedicated(unsigned int gpio)\n+{\n+\tstruct gpio_chip *gc = gpio_to_chip(gpio);\n+\tstruct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);\n+\tstruct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc);\n+\tstruct qe_pio_regs __iomem *regs = mm_gc->regs;\n+\tstruct qe_pio_regs *sregs = &qe_gc->saved_regs;\n+\tu8 pin = gpio - gc->base;\n+\tu32 mask1 = 1 << (QE_PIO_PINS - (pin + 1));\n+\tu32 mask2 = 0x3 << (QE_PIO_PINS - (pin % (QE_PIO_PINS / 2) + 1) * 2);\n+\tbool second_reg = pin > (QE_PIO_PINS / 2) - 1;\n+\tunsigned long flags;\n+\n+\tspin_lock_irqsave(&qe_gc->lock, flags);\n+\n+\tif (second_reg) {\n+\t\tclrsetbits_be32(®s->cpdir2, mask2, sregs->cpdir2 & mask2);\n+\t\tclrsetbits_be32(®s->cppar2, mask2, sregs->cppar2 & mask2);\n+\t} else {\n+\t\tclrsetbits_be32(®s->cpdir1, mask2, sregs->cpdir1 & mask2);\n+\t\tclrsetbits_be32(®s->cppar1, mask2, sregs->cppar1 & mask2);\n+\t}\n+\n+\tif (sregs->cpdata & mask1)\n+\t\tqe_gc->cpdata |= mask1;\n+\telse\n+\t\tqe_gc->cpdata &= ~mask1;\n+\n+\tout_be32(®s->cpdata, qe_gc->cpdata);\n+\tclrsetbits_be32(®s->cpodr, mask1, sregs->cpodr & mask1);\n+\n+\tspin_unlock_irqrestore(&qe_gc->lock, flags);\n+\n+\treturn 0;\n+}\n+EXPORT_SYMBOL(qe_gpio_set_dedicated);\n+\n static int __init qe_add_gpiochips(void)\n {\n \tstruct device_node *np;\n", "prefixes": [ "2/3" ] }