From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id D03E57E22E for ; Fri, 13 Apr 2018 16:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752081AbeDMQoW (ORCPT ); Fri, 13 Apr 2018 12:44:22 -0400 Received: from mail-yw0-f202.google.com ([209.85.161.202]:53719 "EHLO mail-yw0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837AbeDMQoU (ORCPT ); Fri, 13 Apr 2018 12:44:20 -0400 Received: by mail-yw0-f202.google.com with SMTP id z15so5808100ywg.20 for ; Fri, 13 Apr 2018 09:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=6SvpxiHjmSq6adDmegfxCgjxarTnxqazICa3X8JlfnQ=; b=BhnD1DprPRdOoZsyyG1jFJs5Rwn4NdSTED5gKnmOLnKRSDHI8t1VCl7tewQewMBgpg Nj89l7oFCcsY9tKtYeVZHnv8tGTMN14VSO04VEVmwCqn6/KrJcVuuumRzsR/TiZHZT8M GsZsh9OXNN4PdSVLy+7G53wlObjmZuB41awicuiCDCkOinOtCvlVkJSQznAU0O/uvobT Gt8Joz7e2Y3hgwKFJOfNs9i1dyF2JKtLKqm37m1hetdqKmmzQ4+ZUcaWBOOwbnF5j8Je 3W1AcsomjbcBlJlN5OuO3dl7Ec0bnoRkMU/lTobqg53y/qTlTiwhtzC7CN7GX+dX1i9q YDgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=6SvpxiHjmSq6adDmegfxCgjxarTnxqazICa3X8JlfnQ=; b=Tu00rRvVvdn50UNWPy4v2TNjs6OBAKR/a04oaMTLcz+jkW3OOSh5Q668ICyJEP883w Xof4AaCU8uzaUra6V3xescaHdnC2Sdhrbm2MXOMiVZW2HwG3yBI5OymFmVZV6/k7AkSO QAnrEY1iKPF1cax6Wb5hrDwYrpD3+KOo7XwG8xP1HeaQoKk3QiNgg3uoSfrbti0RG1rg gAjE2JDews/wZNxfJFxYLus8Su5Tnci8ZsIPIqKf/vULQ4TJx63W7on6U8kjXJb93il9 vmnIIThUjKjCN/eN+I4xpDL2bsWmHoQHBxb6zaoRrPUGJxml88+vrE1WAQS3pDnGqW3G Ggbg== X-Gm-Message-State: ALQs6tBKx2QUXUbXjidkPwseDa+PtQlWbE3VdJT+aMVHSm+FkN1xuwRI 5oNt0+iFds8H497UBPWLrmsMlkgzcWPF X-Google-Smtp-Source: AIpwx48ED9H07Dmaa4qJknbrTvVUVPCbMdRVMvKOOUowV4okfNgV1Gsk4J2xe+1MaOTWKZk+R9RdAiR2U+YK MIME-Version: 1.0 X-Received: by 10.129.157.3 with SMTP id u3mr1699421ywg.136.1523637860206; Fri, 13 Apr 2018 09:44:20 -0700 (PDT) Date: Fri, 13 Apr 2018 09:44:03 -0700 In-Reply-To: Message-Id: <20180413164405.127522-1-hansens@google.com> References: X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog Subject: [PATCH v2 1/3] Documentation/i2c: whitespace cleanup From: Sam Hansen To: linux-i2c@vger.kernel.org, hansens@google.com, wsa@the-dreams.de, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sam Hansen , wsa@the-dreams.de, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org This strips trailing whitespace in Documentation/i2c/dev-interface. Signed-off-by: Sam Hansen --- Documentation/i2c/dev-interface | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/i2c/dev-interface b/Documentation/i2c/dev-interface index d04e6e4964ee..c8737d502791 100644 --- a/Documentation/i2c/dev-interface +++ b/Documentation/i2c/dev-interface @@ -9,8 +9,8 @@ i2c adapters present on your system at a given time. i2cdetect is part of the i2c-tools package. I2C device files are character device files with major device number 89 -and a minor device number corresponding to the number assigned as -explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ..., +and a minor device number corresponding to the number assigned as +explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ..., i2c-10, ...). All 256 minor device numbers are reserved for i2c. @@ -38,7 +38,7 @@ Next thing, open the device file, as follows: int file; int adapter_nr = 2; /* probably dynamically determined */ char filename[20]; - + snprintf(filename, 19, "/dev/i2c-%d", adapter_nr); file = open(filename, O_RDWR); if (file < 0) { @@ -72,7 +72,7 @@ the device supports them. Both are illustrated below. /* res contains the read word */ } - /* Using I2C Write, equivalent of + /* Using I2C Write, equivalent of i2c_smbus_write_word_data(file, reg, 0x6543) */ buf[0] = reg; buf[1] = 0x43; @@ -147,7 +147,7 @@ You can do plain i2c transactions by using read(2) and write(2) calls. You do not need to pass the address byte; instead, set it through ioctl I2C_SLAVE before you try to access the device. -You can do SMBus level transactions (see documentation file smbus-protocol +You can do SMBus level transactions (see documentation file smbus-protocol for details) through the following functions: __s32 i2c_smbus_write_quick(int file, __u8 value); __s32 i2c_smbus_read_byte(int file); @@ -158,7 +158,7 @@ for details) through the following functions: __s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value); __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value); __s32 i2c_smbus_read_block_data(int file, __u8 command, __u8 *values); - __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, + __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, __u8 *values); All these transactions return -1 on failure; you can read errno to see what happened. The 'write' transactions return 0 on success; the -- 2.17.0.484.g0c8726318c-goog -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html