Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp868650rwi; Thu, 13 Oct 2022 06:21:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wQ50tBbqgupiAYbk4TxZJ5KwFRgQgPyjWY4T+hcd/r9wg3lD5aLf9LLI0U9Py4b8ohLdd X-Received: by 2002:a05:6402:1856:b0:458:db1e:20ec with SMTP id v22-20020a056402185600b00458db1e20ecmr32625174edy.14.1665667280244; Thu, 13 Oct 2022 06:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665667280; cv=none; d=google.com; s=arc-20160816; b=E6at9M/k5Jlqybbpt2gG5Zg9ZMOIcGxwSHVr/9xVpznuEP77eSWHy496b6FCWYQWs2 WKGpD+mF76jJaPG23T7WGeuilD0BpMEwBrL1idmKgq8Y3wVVoDgW7vafs8u0mGea+AW0 uWjE3ldCNPJconnTYFh2Z/jjapbUnVGVvql83U7L8HcxFv0mCd9ZX8F+zUzSOWNsuXLk WHA8O1AUG4eQMBqcUlQrYyln44TaGJqf3pKgc+cot+8I4lQctYtKaFwpeJXJ9wF19K6j 4LLP2ltBlKQFfwTZpH1+/XDXzqS6bL8Vpscpck6WUYYDWpekZq+QJHPnBRTylxap0y+u 9hWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mWjMckfYO6R3pT1gH/T7HL/KjgENyPTv8P7zBRmvj2E=; b=LxAOjXg9zvPWTI9nkDico+xTFmrbpdtAgwGos8FMDRtZ2waJvlVSGagh25lh5P8xOX pEiWR4NKyUKqAvExH8ktJnOcxMe4vy+fOu4bDHCc+XSPZIDSGST2XO0OdZG1XRfaoL3j lfT0o+Gfve7vSeUkeBxxQKrsgDkurM1p1YPjt4/T7wSiZAVP3XtWdzfwuF5kDo051jiR uGKwFsBPvVucruxR2O7GqJXhD48Js7Q6I1b8Vikdls4+P2hX0Ldjs4x4yP1WI5Cu/UPm Ile+AD/XHspVK32o1xOMqsv8alV3bp+Cmb6NeMKfMtP73nzFiNyZ6ac3NPNzB7sv/5Fm /L3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XvDln5tw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du19-20020a17090772d300b0078d4e67ca81si21677864ejc.605.2022.10.13.06.20.49; Thu, 13 Oct 2022 06:21:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XvDln5tw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbiJMM3d (ORCPT + 99 others); Thu, 13 Oct 2022 08:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiJMM3b (ORCPT ); Thu, 13 Oct 2022 08:29:31 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F6211B2D6 for ; Thu, 13 Oct 2022 05:29:30 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id f8so952090qkg.3 for ; Thu, 13 Oct 2022 05:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mWjMckfYO6R3pT1gH/T7HL/KjgENyPTv8P7zBRmvj2E=; b=XvDln5twKivFEbGCXI+A5Pm/le3Z6axjz7FnqktjCKTSru73E7KUZtJ7bz7/AGR3T9 GoXY5M5rTphPUyLT9MVVaKopNZEgGXP7HGdMWURJ7oBNU4RPTdUcILdpUZIvo4bQkvt8 dTBKnFcU9CAv/kMpWOBMi/wauHGyFlcTxPlCYS/Q0HNCSs3NraT5VllMG06lh8WjoyWM JhGAuQY9IE7FqV8RQhJwsfBcmmFhOh1oDkBILgi+SW+R61jamHKA91QPrMUvQmek4542 IRA3zuOmu+XrAKPjtV3gv+uTTjbMb1D2GeH973VoqdS7S8+CoLyplGRyxhoDqmvXg27d qi6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mWjMckfYO6R3pT1gH/T7HL/KjgENyPTv8P7zBRmvj2E=; b=TqZcoN4ZkL7GgPqY54jh2crpvb95wnWrMIWrwGZ49uCxRYzuSOxZ1kfPeANG6RHnSb j/9M+7mxqc+9Ghx4L2b/8G7kp5zsUv/Af51jfHzOrccGU0d0+vBEgz8dyic16u5dvtkw /emrdUv8Odw+czDtDP8IdU8GGJVHTrVEDCCrYj5/n6MEcBY35BlZHQktNhFCRRxGp1s0 ETUENbmBwPdYWAuKryC3DFfJJixTyFZZjRm5pIk/Eq4pKI18JkG1EwOeU/QSfkZ6+g/j sHMMc7/9u4h+5M9SDiBmB/aeYtuac+18GCAZKzxa7yMqAd9fxNBJq0Iwr1gVuBof4xey NY3g== X-Gm-Message-State: ACrzQf2bJ3G//8KRjRa21DCaGM58A+1AXH+kvrWp1tAtYqqeDW1ELVsH XZAwCq/QarRHS/XdqCWJEAuY51LUiJZT/Q== X-Received: by 2002:a05:620a:2891:b0:6bc:5c73:9728 with SMTP id j17-20020a05620a289100b006bc5c739728mr23863484qkp.178.1665664158502; Thu, 13 Oct 2022 05:29:18 -0700 (PDT) Received: from [192.168.1.57] (cpe-72-225-192-120.nyc.res.rr.com. [72.225.192.120]) by smtp.gmail.com with ESMTPSA id f7-20020a05620a408700b006bbc3724affsm18599984qko.45.2022.10.13.05.29.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Oct 2022 05:29:17 -0700 (PDT) Message-ID: Date: Thu, 13 Oct 2022 08:27:05 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH v1 1/5] soc: hpe: add support for HPE GXP Programmable Register Driver To: "Hawkins, Nick" Cc: "Verdun, Jean-Marie" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "linux@armlinux.org.uk" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" References: <20221011185525.94210-1-nick.hawkins@hpe.com> <20221011185525.94210-2-nick.hawkins@hpe.com> Content-Language: en-US From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/10/2022 16:25, Hawkins, Nick wrote: > Greetings Krysztof, > > Thanks for the feedback! I have several questions below: > >>> + >>> +static ssize_t server_id_show(struct device *dev, struct >>> +device_attribute *attr, char *buf) { >>> + struct gxp_plreg_drvdata *drvdata = dev_get_drvdata(dev); >>> + int value_upper; >>> + int value_lower; >>> + ssize_t ret; >>> + u32 trans_offset; >>> + u32 trans_shift; >>> + >>> + /* read upper first */ >>> + address_translation(drvdata->server_id.upper[BYTE], >>> + &trans_offset, >>> + &trans_shift); >>> + regmap_read(drvdata->plreg_map, trans_offset, &value_upper); >>> + value_upper = value_upper >> trans_shift; >>> + value_upper = value_upper & drvdata->server_id.upper[MASK]; >>> + >>> + /* read lower last */ >>> + address_translation(drvdata->server_id.lower[BYTE], >>> + &trans_offset, >>> + &trans_shift); >>> + regmap_read(drvdata->plreg_map, trans_offset, &value_lower); >>> + value_lower = value_lower >> trans_shift; >>> + value_lower = value_lower & drvdata->server_id.lower[MASK]; >>> + >>> + ret = sprintf(buf, "0x%04x", value_upper | value_lower); >>> + >>> + return ret; >>> +} >>> + >>> +static DEVICE_ATTR_RO(server_id); > >> Missing sysfs documentation. > > Can you point me at the proper location / documentation for documenting sysfs? Thanks! Documentation/ABI/README > >>> + for (i = 0; i <= MASK; i++) { >>> + if (of_property_read_u32_index(np, "grp5", i, >>> + &drvdata->grp_intr_flags.grp5[i])) { >>> + dev_err(&pdev->dev, >>> + "grp5intsflags is missing its 'grp5' property index %d\n", i); >>> + return -ENODEV; >>> + } >>> + } >>> + >>> + np = of_get_child_by_name(pdev->dev.of_node, "pwrbtn"); >>> + if (!np) { >>> + dev_err(&pdev->dev, "%pOF is missing its 'pwrbtn' node\n", np); >>> + return -ENODEV; >>> + } >>> + >>> + for (i = 0; i <= VALUE; i++) { >>> + if (of_property_read_u32_index(np, "latch", i, >>> +&drvdata->pwrbtn.latch[i])) { > >> Undocumented properties. NAK. > > If each child node of hpe,gxp-plreg were documented with their respective properties would this be acceptable? I would need to see the bindings. Best regards, Krzysztof