[{"id":1781716,"web_url":"http://patchwork.ozlabs.org/comment/1781716/","msgid":"<CAFEAcA-AnBaHadyHaOuS4648b3W3AXngMs9k9hCCDXyXBSLvTg@mail.gmail.com>","list_archive_url":null,"date":"2017-10-06T15:12:51","subject":"Re: [Qemu-devel] [PATCH v2 5/6] misc: add pca9552 LED blinker model","submitter":{"id":5111,"url":"http://patchwork.ozlabs.org/api/people/5111/","name":"Peter Maydell","email":"peter.maydell@linaro.org"},"content":"On 20 September 2017 at 08:01, Cédric Le Goater <clg@kaod.org> wrote:\n> Specs are available here :\n>\n>   https://www.nxp.com/docs/en/data-sheet/PCA9552.pdf\n>\n> This is a simple model supporting the basic registers for led and GPIO\n> mode. The device also supports two blinking rates but not the model\n> yet.\n>\n> Signed-off-by: Cédric Le Goater <clg@kaod.org>\n\n\n> --- /dev/null\n> +++ b/include/hw/misc/pca9552.h\n> @@ -0,0 +1,32 @@\n> +/*\n> + * PCA9552 I2C LED blinker\n> + *\n> + * Copyright (c) 2017, IBM Corporation.\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or\n> + * later. See the COPYING file in the top-level directory.\n> + */\n> +#ifndef PCA9552_H\n> +#define PCA9552_H\n> +\n> +#include \"hw/i2c/i2c.h\"\n> +\n> +#define TYPE_PCA9552 \"pca9552\"\n> +#define PCA9552(obj) OBJECT_CHECK(PCA9552State, (obj), TYPE_PCA9552)\n> +\n> +\n> +#define PCA9552_NR_REGS 10\n> +\n> +typedef struct PCA9552State {\n> +    /*< private >*/\n> +    I2CSlave i2c;\n> +    /*< public >*/\n> +\n> +    uint8_t len;\n> +    uint8_t pointer;\n> +    uint8_t buf[1]; /* just to remember how to handle a larger buffer */\n\nChanging this later is going to be a migration compatibility break\n(or at least a bit painful to keep compat).\nDo we know how big the buffer is supposed to be? If so it would\nbe best to make it the correct size to start with.\n\n> +\n> +    uint8_t regs[PCA9552_NR_REGS];\n> +} PCA9552State;\n\nthanks\n-- PMM","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"b4tSHDY/\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y7tSh6RvDz9t3m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  7 Oct 2017 02:13:39 +1100 (AEDT)","from localhost ([::1]:45432 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1e0UJl-0001mp-4q\n\tfor incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 11:13:37 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38158)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peter.maydell@linaro.org>) id 1e0UJO-0001mD-8L\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 11:13:15 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peter.maydell@linaro.org>) id 1e0UJM-0004xL-VC\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 11:13:14 -0400","from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:47457)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <peter.maydell@linaro.org>)\n\tid 1e0UJM-0004vm-P4\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 11:13:12 -0400","by mail-wr0-x236.google.com with SMTP id y44so7931163wrd.4\n\tfor <qemu-devel@nongnu.org>; Fri, 06 Oct 2017 08:13:12 -0700 (PDT)","by 10.223.128.207 with HTTP; Fri, 6 Oct 2017 08:12:51 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=Yltg+2shbtuQB5Ot2XsSyRsYrhqMtxxns5ezWUJ1kPU=;\n\tb=b4tSHDY/gRrPMv6+r09WEnXy+G6ZLAKITNf6D67GGOEhcNqfWKSB4nI0SPfOLj6R2n\n\tqknvfcP8hFbBh7OtNW5YlIgHt/3fqHM7d/x3eThmPuCiLuPtJWE4Yc99bFo0xNScFaod\n\tIsn0A3NbQ7lJ/GvX1hjdlhSiVpEnOUqV9OQIk=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=Yltg+2shbtuQB5Ot2XsSyRsYrhqMtxxns5ezWUJ1kPU=;\n\tb=uoMNm8O5/bkFoC1riGi15N/ZK0DFazk3yntGVXBhcKI7Y3V4xGLDfX5SiD20ozcZlj\n\tI1qdrsZ2/Xe/Rc0rx2+6irGyXadzV0jZXquwpEekonQfDcOEC4eEvhFVwDAkUVDZc9NX\n\t/4SGrCo02fHL5iUW/DGuwFkjtHWnQ9VGwHjuVXqPrtXb5BomTvbgtj8HsjQhiThPdL4B\n\tsdZd7Z+Ef1UtfVrowKYdlrqooNZRvxlbfwwtXSEJqiTkGPXln0tLIyMk3dctyFUGp5El\n\tvHEbt5UzBsqr0tZPrNpaShoUdg/+SZMPwS1B4iBW6+T+pADDXti3XBLzTuWXYnL5SAuf\n\tPVmg==","X-Gm-Message-State":"AMCzsaU1Rj9rp/FSFynbOSLi4IcZ5J5QtaNYXa0TfcCxAEc/ELv/v07x\n\t5dD2omfLgmwiflnFYHQkHg/XNvoccIXZQAAiFoiecA==","X-Google-Smtp-Source":"AOwi7QBn/csxtiDLnfjRJlLZcYIs0OGdgj6ThY67RzgvqOvS7K8IryKLbkuhBOeDUW/9o5eiHe7/ELi5oWyN+93znFI=","X-Received":"by 10.223.175.56 with SMTP id z53mr2615464wrc.177.1507302791733; \n\tFri, 06 Oct 2017 08:13:11 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170920070135.31379-6-clg@kaod.org>","References":"<20170920070135.31379-1-clg@kaod.org>\n\t<20170920070135.31379-6-clg@kaod.org>","From":"Peter Maydell <peter.maydell@linaro.org>","Date":"Fri, 6 Oct 2017 16:12:51 +0100","Message-ID":"<CAFEAcA-AnBaHadyHaOuS4648b3W3AXngMs9k9hCCDXyXBSLvTg@mail.gmail.com>","To":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c0c::236","Subject":"Re: [Qemu-devel] [PATCH v2 5/6] misc: add pca9552 LED blinker model","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Andrew Jeffery <andrew@aj.id.au>, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?b?w6k=?= <f4bug@amsat.org>, qemu-arm <qemu-arm@nongnu.org>,\n\tQEMU Developers <qemu-devel@nongnu.org>, \tJoel Stanley <joel@jms.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1782150,"web_url":"http://patchwork.ozlabs.org/comment/1782150/","msgid":"<2a6d818e-4306-1189-cddb-79cc2eea8499@kaod.org>","list_archive_url":null,"date":"2017-10-07T16:41:42","subject":"Re: [Qemu-devel] [PATCH v2 5/6] misc: add pca9552 LED blinker model","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"On 10/06/2017 05:12 PM, Peter Maydell wrote:\n> On 20 September 2017 at 08:01, Cédric Le Goater <clg@kaod.org> wrote:\n>> Specs are available here :\n>>\n>>   https://www.nxp.com/docs/en/data-sheet/PCA9552.pdf\n>>\n>> This is a simple model supporting the basic registers for led and GPIO\n>> mode. The device also supports two blinking rates but not the model\n>> yet.\n>>\n>> Signed-off-by: Cédric Le Goater <clg@kaod.org>\n> \n> \n>> --- /dev/null\n>> +++ b/include/hw/misc/pca9552.h\n>> @@ -0,0 +1,32 @@\n>> +/*\n>> + * PCA9552 I2C LED blinker\n>> + *\n>> + * Copyright (c) 2017, IBM Corporation.\n>> + *\n>> + * This work is licensed under the terms of the GNU GPL, version 2 or\n>> + * later. See the COPYING file in the top-level directory.\n>> + */\n>> +#ifndef PCA9552_H\n>> +#define PCA9552_H\n>> +\n>> +#include \"hw/i2c/i2c.h\"\n>> +\n>> +#define TYPE_PCA9552 \"pca9552\"\n>> +#define PCA9552(obj) OBJECT_CHECK(PCA9552State, (obj), TYPE_PCA9552)\n>> +\n>> +\n>> +#define PCA9552_NR_REGS 10\n>> +\n>> +typedef struct PCA9552State {\n>> +    /*< private >*/\n>> +    I2CSlave i2c;\n>> +    /*< public >*/\n>> +\n>> +    uint8_t len;\n>> +    uint8_t pointer;\n>> +    uint8_t buf[1]; /* just to remember how to handle a larger buffer */\n> \n> Changing this later is going to be a migration compatibility break\n> (or at least a bit painful to keep compat).\n> Do we know how big the buffer is supposed to be? \n\none. \n\n> If so it would be best to make it the correct size to start with.\n\nyes I will change that.\n\nThanks,\n\nC.\n\n> \n>> +\n>> +    uint8_t regs[PCA9552_NR_REGS];\n>> +} PCA9552State;\n> \n> thanks\n> -- PMM\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y8XNd3qXFz9t6W\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  8 Oct 2017 03:42:24 +1100 (AEDT)","from localhost ([::1]:50410 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1e0sBA-0006vA-J7\n\tfor incoming@patchwork.ozlabs.org; Sat, 07 Oct 2017 12:42:20 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41565)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1e0sAn-0006st-4x\n\tfor qemu-devel@nongnu.org; Sat, 07 Oct 2017 12:41:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1e0sAk-0004CC-02\n\tfor qemu-devel@nongnu.org; Sat, 07 Oct 2017 12:41:57 -0400","from 1.mo177.mail-out.ovh.net ([178.33.107.143]:45686)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <clg@kaod.org>) id 1e0sAj-0004BJ-QB\n\tfor qemu-devel@nongnu.org; Sat, 07 Oct 2017 12:41:53 -0400","from player779.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo177.mail-out.ovh.net (Postfix) with ESMTP id DE6C181C1C\n\tfor <qemu-devel@nongnu.org>; Sat,  7 Oct 2017 18:41:50 +0200 (CEST)","from zorba.kaod.org (i15-les03-th2-31-37-69-229.sfr.lns.abo.bbox.fr\n\t[31.37.69.229]) (Authenticated sender: postmaster@kaod.org)\n\tby player779.ha.ovh.net (Postfix) with ESMTPSA id C7E127C0084;\n\tSat,  7 Oct 2017 18:41:42 +0200 (CEST)"],"To":"Peter Maydell <peter.maydell@linaro.org>","References":"<20170920070135.31379-1-clg@kaod.org>\n\t<20170920070135.31379-6-clg@kaod.org>\n\t<CAFEAcA-AnBaHadyHaOuS4648b3W3AXngMs9k9hCCDXyXBSLvTg@mail.gmail.com>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<2a6d818e-4306-1189-cddb-79cc2eea8499@kaod.org>","Date":"Sat, 7 Oct 2017 18:41:42 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<CAFEAcA-AnBaHadyHaOuS4648b3W3AXngMs9k9hCCDXyXBSLvTg@mail.gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","X-Ovh-Tracer-Id":"274156629267549124","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrleehgddutdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"178.33.107.143","Subject":"Re: [Qemu-devel] [PATCH v2 5/6] misc: add pca9552 LED blinker model","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Andrew Jeffery <andrew@aj.id.au>, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?b?w6k=?= <f4bug@amsat.org>, qemu-arm <qemu-arm@nongnu.org>,\n\tQEMU Developers <qemu-devel@nongnu.org>, \tJoel Stanley <joel@jms.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]