Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package i2c-tools for openSUSE:Factory 
checked in at 2024-10-12 13:24:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/i2c-tools (Old)
 and      /work/SRC/openSUSE:Factory/.i2c-tools.new.19354 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "i2c-tools"

Sat Oct 12 13:24:45 2024 rev:41 rq:1207149 version:4.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/i2c-tools/i2c-tools.changes      2023-07-17 
19:23:41.921880722 +0200
+++ /work/SRC/openSUSE:Factory/.i2c-tools.new.19354/i2c-tools.changes   
2024-10-12 13:25:00.378488076 +0200
@@ -1,0 +2,14 @@
+Fri Oct 11 11:15:00 UTC 2024 - Jean Delvare <jdelv...@suse.com>
+
+- Update to version 4.4:
+  * tools: Use getopt
+           Implement and document option -h
+  * i2cdetect: Display more functionality bits with option -F
+  * i2cdump: Remove support for SMBus block mode
+  * i2cget: Document SMBus block mode
+  * i2ctransfer: Sort command line options and add to help text
+                 Add an option to print binary data
+                 Drop redundant variable arg_idx
+  * py-smbus: Use setuptools instead of distutils
+
+-------------------------------------------------------------------

Old:
----
  i2c-tools-4.3.tar.sign
  i2c-tools-4.3.tar.xz

New:
----
  i2c-tools-4.4.tar.sign
  i2c-tools-4.4.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ i2c-tools.spec ++++++
--- /var/tmp/diff_new_pack.zp0EQI/_old  2024-10-12 13:25:00.842507307 +0200
+++ /var/tmp/diff_new_pack.zp0EQI/_new  2024-10-12 13:25:00.842507307 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package i2c-tools
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 %endif
 
 Name:           i2c-tools
-Version:        4.3
+Version:        4.4
 Release:        0
 Summary:        A heterogeneous set of I2C tools for Linux
 License:        GPL-2.0-or-later

++++++ i2c-tools-4.3.tar.xz -> i2c-tools-4.4.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/CHANGES new/i2c-tools-4.4/CHANGES
--- old/i2c-tools-4.3/CHANGES   2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/CHANGES   2024-10-10 15:58:45.000000000 +0200
@@ -1,6 +1,21 @@
 i2c-tools CHANGES
 -----------------
 
+4.4 (2024-10-10)
+  tools: Use getopt
+         Implement and document option -h
+  eeprog: Use force option when data comes from a pipe
+  i2cdetect: Display more functionality bits with option -F
+  i2cdump: Remove support for SMBus block mode
+  i2cget: Document SMBus block mode
+          Fix the return code of option -h
+  i2cset: Fix the return code of option -h
+  i2ctransfer: Sort command line options and add to help text
+               Add an option to print binary data
+               Drop redundant variable arg_idx
+  py-smbus: Install in the defined prefix
+            Use setuptools instead of distutils
+
 4.3 (2021-07-22)
   decode-dimms: Attempt to decode LPDDR3 modules
   eeprom, eepromer: Removed the tools in favor of eeprog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/Makefile new/i2c-tools-4.4/Makefile
--- old/i2c-tools-4.3/Makefile  2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/Makefile  2024-10-10 15:58:45.000000000 +0200
@@ -50,8 +50,6 @@
 endif
 endif
 
-KERNELVERSION  := $(shell uname -r)
-
 .PHONY: all strip clean install uninstall
 
 all:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/README new/i2c-tools-4.4/README
--- old/i2c-tools-4.3/README    2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/README    2024-10-10 15:58:45.000000000 +0200
@@ -106,3 +106,11 @@
   Jean Delvare <jdelv...@suse.de>
 For additional information about this list, see:
   http://vger.kernel.org/vger-lists.html#linux-i2c
+
+CONTRIBUTIONS
+-------------
+
+Contributions are very welcome. Please send them to the linux-i2c mailing list
+mentioned above. Make sure they include a 'Developer's certificate of origin'
+as used for the Linux Kernel and described here:
+  
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprog/eeprog.8 
new/i2c-tools-4.4/eeprog/eeprog.8
--- old/i2c-tools-4.3/eeprog/eeprog.8   2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/eeprog/eeprog.8   2024-10-10 15:58:45.000000000 +0200
@@ -12,10 +12,6 @@
 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 .\"  GNU General Public License for more details.
 .\"
-.\"  You should have received a copy of the GNU General Public License along
-.\"  with this program; if not, write to the Free Software Foundation, Inc.,
-.\"  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
 .TH eeprog "8" "Jul 2013" "i2c-tools" "System Administration"
 .SH NAME
 eeprog \- reads and writes 24Cxx EEPROMs connected to I2C serial bus
@@ -95,6 +91,6 @@
 .P
        date |
 .B eeprog
-/dev/i2c-0 0x33 -w 0x200
+-f /dev/i2c-0 0x33 -w 0x200
 .SH AUTHOR
 Stefano Barbato
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprog/eeprog.c 
new/i2c-tools-4.4/eeprog/eeprog.c
--- old/i2c-tools-4.3/eeprog/eeprog.c   2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/eeprog/eeprog.c   2024-10-10 15:58:45.000000000 +0200
@@ -65,7 +65,7 @@
 "              eeprog /dev/i2c-1 0x51 -x -r 0x22:0x20\n"
 "      3- write the current timestamp at address 0x200 of the EEPROM on\n"
 "         bus 0 at address 0x33\n"
-"              date | eeprog /dev/i2c-0 0x33 -w 0x200\n";
+"              date | eeprog -f /dev/i2c-0 0x33 -w 0x200\n";
 
        if(!b)
                return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprom/ddcmon 
new/i2c-tools-4.4/eeprom/ddcmon
--- old/i2c-tools-4.3/eeprom/ddcmon     2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/eeprom/ddcmon     2024-10-10 15:58:45.000000000 +0200
@@ -21,11 +21,6 @@
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
-#    You should have received a copy of the GNU General Public License
-#    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#    MA 02110-1301 USA.
-#
 # This script is a replacement for the now deprecated ddcmon kernel driver.
 # Instead of having a dedicated driver, it is better to reuse the standard
 # eeprom driver and implement the EDID-specific code in user-space.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprom/decode-dimms 
new/i2c-tools-4.4/eeprom/decode-dimms
--- old/i2c-tools-4.3/eeprom/decode-dimms       2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/eeprom/decode-dimms       2024-10-10 15:58:45.000000000 
+0200
@@ -17,11 +17,6 @@
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
-#    You should have received a copy of the GNU General Public License
-#    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#    MA 02110-1301 USA.
-#
 # A kernel driver must be loaded (unless option -x is used). Up to DDR3,
 # you need either the at24 driver (in the kernel tree since v2.6.27) or
 # the legacy eeprom driver (in the kernel tree since v2.6.0). For kernels
@@ -35,7 +30,7 @@
 # 1997,1999, Rev 1.2B
 #
 # Jedec Standards 4.1.x & 4.5.x
-# http://www.jedec.org
+# https://www.jedec.org/
 #
 
 require 5.004;
@@ -50,7 +45,7 @@
 
 use constant LITTLEENDIAN      => "little-endian";
 use constant BIGENDIAN         => "big-endian";
-use constant I2C_TOOLS_VER     => "4.3";
+use constant I2C_TOOLS_VER     => "4.4";
 
 @vendors = (
 ["AMD", "AMI", "Fairchild", "Fujitsu",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprom/decode-dimms.1 
new/i2c-tools-4.4/eeprom/decode-dimms.1
--- old/i2c-tools-4.3/eeprom/decode-dimms.1     2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/eeprom/decode-dimms.1     2024-10-10 15:58:45.000000000 
+0200
@@ -13,10 +13,6 @@
 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 .\"  GNU General Public License for more details.
 .\"
-.\"  You should have received a copy of the GNU General Public License along
-.\"  with this program; if not, write to the Free Software Foundation, Inc.,
-.\"  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
 .TH decode-dimms 1 "Nov 2017" "i2c-tools" "User Commands"
 .SH NAME
 decode-dimms \- decode the information found in memory module SPD EEPROMs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprom/decode-edid 
new/i2c-tools-4.4/eeprom/decode-edid
--- old/i2c-tools-4.3/eeprom/decode-edid        2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/eeprom/decode-edid        2024-10-10 15:58:45.000000000 
+0200
@@ -12,11 +12,6 @@
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
-#    You should have received a copy of the GNU General Public License
-#    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#    MA 02110-1301 USA.
-#
 # EEPROM data decoding for EDID. EDID (Extended Display Identification
 # Data) is a VESA standard which allows storing (on manufacturer's side)
 # and retrieving (on user's side) of configuration information about
@@ -36,7 +31,7 @@
 # what it finds in /proc to binary data to feed the parse-edid program.
 # The parse-edid program was written by John Fremlin and is available at
 # the following address:
-#   http://john.fremlin.de/programs/linux/read-edid/
+#   http://www.polypux.org/projects/read-edid/
 
 use strict;
 use Fcntl qw(:DEFAULT :seek);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprom/decode-vaio 
new/i2c-tools-4.4/eeprom/decode-vaio
--- old/i2c-tools-4.3/eeprom/decode-vaio        2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/eeprom/decode-vaio        2024-10-10 15:58:45.000000000 
+0200
@@ -12,11 +12,6 @@
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
-#    You should have received a copy of the GNU General Public License
-#    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-#    MA 02110-1301 USA.
-#
 # EEPROM data decoding for Sony Vaio laptops.
 #
 # The at24 or eeprom driver must be loaded. For kernels older than 2.6.0, the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/eeprom/decode-vaio.1 
new/i2c-tools-4.4/eeprom/decode-vaio.1
--- old/i2c-tools-4.3/eeprom/decode-vaio.1      2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/eeprom/decode-vaio.1      2024-10-10 15:58:45.000000000 
+0200
@@ -12,10 +12,6 @@
 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 .\"  GNU General Public License for more details.
 .\"
-.\"  You should have received a copy of the GNU General Public License along
-.\"  with this program; if not, write to the Free Software Foundation, Inc.,
-.\"  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
 .TH decode-vaio 1 "Oct 2013" "i2c-tools" "User Commands"
 .SH NAME
 decode-vaio \- decode the information found in the Sony Vaio laptop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/py-smbus/Module.mk 
new/i2c-tools-4.4/py-smbus/Module.mk
--- old/i2c-tools-4.3/py-smbus/Module.mk        2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/py-smbus/Module.mk        2024-10-10 15:58:45.000000000 
+0200
@@ -22,7 +22,7 @@
        rm -rf py-smbus/build
 
 install-python:
-       $(DISTUTILS) install
+       $(DISTUTILS) install --prefix="$(PREFIX)"
 
 all: all-python
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/py-smbus/setup.py 
new/i2c-tools-4.4/py-smbus/setup.py
--- old/i2c-tools-4.3/py-smbus/setup.py 2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/py-smbus/setup.py 2024-10-10 15:58:45.000000000 +0200
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from distutils.core import setup, Extension
+from setuptools import setup, Extension
 
 setup( name="smbus",
        version="1.1",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/py-smbus/smbusmodule.c 
new/i2c-tools-4.4/py-smbus/smbusmodule.c
--- old/i2c-tools-4.3/py-smbus/smbusmodule.c    2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/py-smbus/smbusmodule.c    2024-10-10 15:58:45.000000000 
+0200
@@ -10,11 +10,6 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
  */
 
 #include <Python.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/stub/i2c-stub-from-dump 
new/i2c-tools-4.4/stub/i2c-stub-from-dump
--- old/i2c-tools-4.3/stub/i2c-stub-from-dump   2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/stub/i2c-stub-from-dump   2024-10-10 15:58:45.000000000 
+0200
@@ -12,11 +12,6 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA
-#
 # This script feeds the i2c-stub driver with dump data from a real
 # I2C or SMBus chip. This can be useful when writing a driver for
 # a device you do not have access to, but of which you have a dump.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cbusses.c 
new/i2c-tools-4.4/tools/i2cbusses.c
--- old/i2c-tools-4.3/tools/i2cbusses.c 2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cbusses.c 2024-10-10 15:58:45.000000000 +0200
@@ -15,11 +15,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 /* For strdup and snprintf */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cbusses.h 
new/i2c-tools-4.4/tools/i2cbusses.h
--- old/i2c-tools-4.3/tools/i2cbusses.h 2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cbusses.h 2024-10-10 15:58:45.000000000 +0200
@@ -12,11 +12,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #ifndef _I2CBUSSES_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cdetect.8 
new/i2c-tools-4.4/tools/i2cdetect.8
--- old/i2c-tools-4.3/tools/i2cdetect.8 2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cdetect.8 2024-10-10 15:58:45.000000000 +0200
@@ -1,4 +1,4 @@
-.TH I2CDETECT 8 "October 2017"
+.TH I2CDETECT 8 "May 2022"
 .SH NAME
 i2cdetect \- detect I2C chips
 
@@ -18,6 +18,9 @@
 .I -V
 .br
 .B i2cdetect
+.I -h
+.br
+.B i2cdetect
 .I -l
 
 .SH DESCRIPTION
@@ -78,6 +81,9 @@
 .B "\-V"
 Display the version and exit.
 .TP
+.B "\-h"
+Display the help and exit.
+.TP
 .B "\-l"
 Output a list of installed busses.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cdetect.c 
new/i2c-tools-4.4/tools/i2cdetect.c
--- old/i2c-tools-4.3/tools/i2cdetect.c 2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cdetect.c 2024-10-10 15:58:45.000000000 +0200
@@ -2,7 +2,7 @@
     i2cdetect.c - a user-space program to scan for I2C devices
     Copyright (C) 1999-2004  Frodo Looijaard <fro...@dds.nl>, and
                              Mark D. Studebaker <mdsxyz...@yahoo.com>
-    Copyright (C) 2004-2012  Jean Delvare <jdelv...@suse.de>
+    Copyright (C) 2004-2022  Jean Delvare <jdelv...@suse.de>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -13,11 +13,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #include <sys/ioctl.h>
@@ -160,6 +155,16 @@
          .name = "I2C Block Write" },
        { .value = I2C_FUNC_SMBUS_READ_I2C_BLOCK,
          .name = "I2C Block Read" },
+#if defined(I2C_FUNC_SMBUS_HOST_NOTIFY)
+       { .value = I2C_FUNC_SMBUS_HOST_NOTIFY,
+         .name = "SMBus Host Notify" },
+#endif
+       { .value = I2C_FUNC_10BIT_ADDR,
+         .name = "10-bit addressing" },
+#if defined(I2C_FUNC_SLAVE)
+       { .value = I2C_FUNC_SLAVE,
+         .name = "Target mode" },
+#endif
        { .value = 0, .name = "" }
 };
 
@@ -205,12 +210,12 @@
        unsigned long funcs;
        int mode = MODE_AUTO;
        int first = 0x08, last = 0x77;
-       int flags = 0;
+       int opt;
        int yes = 0, version = 0, list = 0;
 
        /* handle (optional) flags first */
-       while (1+flags < argc && argv[1+flags][0] == '-') {
-               switch (argv[1+flags][1]) {
+       while ((opt = getopt(argc, argv, "FVahlqry")) != -1) {
+               switch (opt) {
                case 'V': version = 1; break;
                case 'y': yes = 1; break;
                case 'l': list = 1; break;
@@ -242,13 +247,11 @@
                        first = 0x00;
                        last = 0x7F;
                        break;
-               default:
-                       fprintf(stderr, "Error: Unsupported option "
-                               "\"%s\"!\n", argv[1+flags]);
+               case 'h':
+               case '?':
                        help();
-                       exit(1);
+                       exit(opt == '?');
                }
-               flags++;
        }
 
        if (version) {
@@ -261,24 +264,24 @@
                exit(0);
        }
 
-       if (argc < flags + 2) {
+       if (argc < optind + 1) {
                fprintf(stderr, "Error: No i2c-bus specified!\n");
                help();
                exit(1);
        }
-       i2cbus = lookup_i2c_bus(argv[flags+1]);
+       i2cbus = lookup_i2c_bus(argv[optind]);
        if (i2cbus < 0) {
                help();
                exit(1);
        }
 
        /* read address range if present */
-       if (argc == flags + 4 && mode != MODE_FUNC) {
+       if (argc == optind + 3 && mode != MODE_FUNC) {
                int tmp;
 
-               tmp = strtol(argv[flags+2], &end, 0);
+               tmp = strtol(argv[optind+1], &end, 0);
                if (*end) {
-                       fprintf(stderr, "Error: FIRST argment not a "
+                       fprintf(stderr, "Error: FIRST argument not a "
                                "number!\n");
                        help();
                        exit(1);
@@ -291,9 +294,9 @@
                }
                first = tmp;
 
-               tmp = strtol(argv[flags+3], &end, 0);
+               tmp = strtol(argv[optind+2], &end, 0);
                if (*end) {
-                       fprintf(stderr, "Error: LAST argment not a "
+                       fprintf(stderr, "Error: LAST argument not a "
                                "number!\n");
                        help();
                        exit(1);
@@ -305,7 +308,7 @@
                        exit(1);
                }
                last = tmp;
-       } else if (argc != flags + 2) {
+       } else if (argc != optind + 1) {
                help();
                exit(1);
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cdump.8 
new/i2c-tools-4.4/tools/i2cdump.8
--- old/i2c-tools-4.3/tools/i2cdump.8   2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cdump.8   2024-10-10 15:58:45.000000000 +0200
@@ -1,4 +1,4 @@
-.TH I2CDUMP 8 "June 2021"
+.TH I2CDUMP 8 "May 2022"
 .SH NAME
 i2cdump \- examine I2C registers
 
@@ -14,6 +14,9 @@
 .br
 .B i2cdump
 .B -V
+.br
+.B i2cdump
+.B -h
 
 .SH DESCRIPTION
 i2cdump is a small helper program to examine registers
@@ -24,6 +27,9 @@
 .B -V
 Display the version and exit.
 .TP
+.B -h
+Display the help and exit.
+.TP
 .B -f
 Force access to the device even if it is already busy. By default, i2cdump
 will refuse to access a device which is already under the control of a
@@ -51,8 +57,8 @@
 address to be scanned on that bus, and is an integer between 0x08 and 0x77.
 .PP
 The \fImode\fR parameter, if specified, is one of the letters \fBb\fP, \fBw\fP,
-\fBs\fP, or \fBi\fP, corresponding to a read size of a single byte, a 16-bit
-word, an SMBus block, an I2C block, respectively. The \fBc\fP mode is a
+or \fBi\fP, corresponding to a read size of a single byte, a 16-bit
+word, an I2C block, respectively. The \fBc\fP mode is a
 little different, it reads all bytes consecutively, and is useful for chips 
that
 have an address auto-increment feature, such as EEPROMs. The \fBW\fP mode is
 also special, it is similar to \fBw\fP except that a read command will only
@@ -112,8 +118,7 @@
 <linux-...@vger.kernel.org> with Cc to the current maintainer:
 Jean Delvare <jdelv...@suse.de>.
 
-SMBus block mode is deprecated and will be removed in a future version
-of this tool.
+SMBus block mode used to be supported by this tool.
 Please use \fIi2cget\fR instead.
 
 .SH SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cdump.c 
new/i2c-tools-4.4/tools/i2cdump.c
--- old/i2c-tools-4.3/tools/i2cdump.c   2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cdump.c   2024-10-10 15:58:45.000000000 +0200
@@ -2,7 +2,7 @@
     i2cdump.c - a user-space program to dump I2C registers
     Copyright (C) 2002-2003  Frodo Looijaard <fro...@dds.nl>, and
                              Mark D. Studebaker <mdsxyz...@yahoo.com>
-    Copyright (C) 2004-2021  Jean Delvare <jdelv...@suse.de>
+    Copyright (C) 2004-2022  Jean Delvare <jdelv...@suse.de>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -13,11 +13,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #include <sys/ioctl.h>
@@ -43,7 +38,6 @@
                "    b (byte, default)\n"
                "    w (word)\n"
                "    W (word on even register addresses)\n"
-               "    s (SMBus block, deprecated)\n"
                "    i (I2C block)\n"
                "    c (consecutive byte)\n"
                "    Append p for SMBus PEC\n");
@@ -86,13 +80,6 @@
                }
                break;
 
-       case I2C_SMBUS_BLOCK_DATA:
-               if (!(funcs & I2C_FUNC_SMBUS_READ_BLOCK_DATA)) {
-                       fprintf(stderr, MISSING_FUNC_FMT, "SMBus block read");
-                       return -1;
-               }
-               break;
-
        case I2C_SMBUS_I2C_BLOCK_DATA:
                if (!(funcs & I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
                        fprintf(stderr, MISSING_FUNC_FMT, "I2C block read");
@@ -116,28 +103,26 @@
        int i, j, res, i2cbus, address, size, file;
        int bank = 0, bankreg = 0x4E, old_bank = 0;
        char filename[20];
-       int block[256], s_length = 0;
+       int block[256];
        int pec = 0, even = 0;
-       int flags = 0;
+       int opt;
        int force = 0, yes = 0, version = 0, all_addrs = 0;
        const char *range = NULL;
        int first = 0x00, last = 0xff;
 
        /* handle (optional) flags first */
-       while (1+flags < argc && argv[1+flags][0] == '-') {
-               switch (argv[1+flags][1]) {
+       while ((opt = getopt(argc, argv, "Vafhr:y")) != -1) {
+               switch (opt) {
                case 'V': version = 1; break;
                case 'f': force = 1; break;
-               case 'r': range = argv[1+(++flags)]; break;
+               case 'r': range = optarg; break;
                case 'y': yes = 1; break;
                case 'a': all_addrs = 1; break;
-               default:
-                       fprintf(stderr, "Error: Unsupported option "
-                               "\"%s\"!\n", argv[1+flags]);
+               case 'h':
+               case '?':
                        help();
-                       exit(1);
+                       exit(opt == '?');
                }
-               flags++;
        }
 
        if (version) {
@@ -145,49 +130,48 @@
                exit(0);
        }
 
-       if (argc < flags + 2) {
+       if (argc < optind + 1) {
                fprintf(stderr, "Error: No i2c-bus specified!\n");
                help();
                exit(1);
        }
-       i2cbus = lookup_i2c_bus(argv[flags+1]);
+       i2cbus = lookup_i2c_bus(argv[optind]);
        if (i2cbus < 0) {
                help();
                exit(1);
        }
 
-       if (argc < flags + 3) {
+       if (argc < optind + 2) {
                fprintf(stderr, "Error: No address specified!\n");
                help();
                exit(1);
        }
-       address = parse_i2c_address(argv[flags+2], all_addrs);
+       address = parse_i2c_address(argv[optind+1], all_addrs);
        if (address < 0) {
                help();
                exit(1);
        }
 
-       if (argc < flags + 4) {
+       if (argc < optind + 3) {
                fprintf(stderr, "No size specified (using byte-data access)\n");
                size = I2C_SMBUS_BYTE_DATA;
-       } else if (!strncmp(argv[flags+3], "b", 1)) {
+       } else if (!strncmp(argv[optind+2], "b", 1)) {
                size = I2C_SMBUS_BYTE_DATA;
-               pec = argv[flags+3][1] == 'p';
-       } else if (!strncmp(argv[flags+3], "w", 1)) {
+               pec = argv[optind+2][1] == 'p';
+       } else if (!strncmp(argv[optind+2], "w", 1)) {
                size = I2C_SMBUS_WORD_DATA;
-               pec = argv[flags+3][1] == 'p';
-       } else if (!strncmp(argv[flags+3], "W", 1)) {
+               pec = argv[optind+2][1] == 'p';
+       } else if (!strncmp(argv[optind+2], "W", 1)) {
                size = I2C_SMBUS_WORD_DATA;
                even = 1;
-       } else if (!strncmp(argv[flags+3], "s", 1)) {
-               size = I2C_SMBUS_BLOCK_DATA;
+       } else if (!strncmp(argv[optind+2], "s", 1)) {
                fprintf(stderr,
-                       "SMBus block mode is deprecated, please use i2cget 
instead\n");
-               pec = argv[flags+3][1] == 'p';
-       } else if (!strncmp(argv[flags+3], "c", 1)) {
+                       "SMBus block mode is no longer supported, please use 
i2cget instead\n");
+               exit(1);
+       } else if (!strncmp(argv[optind+2], "c", 1)) {
                size = I2C_SMBUS_BYTE;
-               pec = argv[flags+3][1] == 'p';
-       } else if (!strcmp(argv[flags+3], "i"))
+               pec = argv[optind+2][1] == 'p';
+       } else if (!strcmp(argv[optind+2], "i"))
                size = I2C_SMBUS_I2C_BLOCK_DATA;
        else {
                fprintf(stderr, "Error: Invalid mode!\n");
@@ -195,8 +179,8 @@
                exit(1);
        }
 
-       if (argc > flags + 4) {
-               bank = strtol(argv[flags+4], &end, 0);
+       if (argc > optind + 3) {
+               bank = strtol(argv[optind+3], &end, 0);
                if (*end || size == I2C_SMBUS_I2C_BLOCK_DATA) {
                        fprintf(stderr, "Error: Invalid bank number!\n");
                        help();
@@ -208,16 +192,10 @@
                        help();
                        exit(1);
                }
-               if (size == I2C_SMBUS_BLOCK_DATA
-                && (bank < 0 || bank > 0xff)) {
-                       fprintf(stderr, "Error: block command out of range!\n");
-                       help();
-                       exit(1);
-               }
 
-               if (argc > flags + 5) {
-                       bankreg = strtol(argv[flags+5], &end, 0);
-                       if (*end || size == I2C_SMBUS_BLOCK_DATA) {
+               if (argc > optind + 4) {
+                       bankreg = strtol(argv[optind+4], &end, 0);
+                       if (*end) {
                                fprintf(stderr, "Error: Invalid bank register "
                                        "number!\n");
                                help();
@@ -250,16 +228,7 @@
                }
 
                /* Check mode constraints */
-               switch (size) {
-               case I2C_SMBUS_BYTE:
-               case I2C_SMBUS_BYTE_DATA:
-               case I2C_SMBUS_I2C_BLOCK_DATA:
-                       break;
-               case I2C_SMBUS_WORD_DATA:
-                       if (!even || (!(first%2) && last%2))
-                               break;
-                       /* Fall through */
-               default:
+               if (size == I2C_SMBUS_WORD_DATA && even && (first%2 || 
!(last%2))) {
                        fprintf(stderr,
                                "Error: Range parameter not compatible with 
selected mode!\n");
                        exit(1);
@@ -286,7 +255,6 @@
 
                fprintf(stderr, "I will probe file %s, address 0x%x, mode "
                        "%s\n", filename, address,
-                       size == I2C_SMBUS_BLOCK_DATA ? "smbus block" :
                        size == I2C_SMBUS_I2C_BLOCK_DATA ? "i2c block" :
                        size == I2C_SMBUS_BYTE ? "byte consecutive read" :
                        size == I2C_SMBUS_BYTE_DATA ? "byte" : "word");
@@ -296,12 +264,8 @@
                        fprintf(stderr, "Only probing even register "
                                "addresses.\n");
                if (bank) {
-                       if (size == I2C_SMBUS_BLOCK_DATA)
-                               fprintf(stderr, "Using command 0x%02x.\n",
-                                       bank);
-                       else
-                               fprintf(stderr, "Probing bank %d using bank "
-                                       "register 0x%02x.\n", bank, bankreg);
+                       fprintf(stderr, "Probing bank %d using bank "
+                               "register 0x%02x.\n", bank, bankreg);
                }
                if (range) {
                        fprintf(stderr,
@@ -318,7 +282,7 @@
        }
 
        /* See Winbond w83781d data sheet for bank details */
-       if (bank && size != I2C_SMBUS_BLOCK_DATA) {
+       if (bank) {
                res = i2c_smbus_read_byte_data(file, bankreg);
                if (res >= 0) {
                        old_bank = res;
@@ -334,25 +298,15 @@
        /* handle all but word data */
        if (size != I2C_SMBUS_WORD_DATA || even) {
                /* do the block transaction */
-               if (size == I2C_SMBUS_BLOCK_DATA
-                || size == I2C_SMBUS_I2C_BLOCK_DATA) {
+               if (size == I2C_SMBUS_I2C_BLOCK_DATA) {
                        unsigned char cblock[288];
 
-                       if (size == I2C_SMBUS_BLOCK_DATA) {
-                               res = i2c_smbus_read_block_data(file, bank,
-                                     cblock);
-                               /* Remember returned block length for a nicer
-                                  display later */
-                               s_length = res;
-                               last = res - 1;
-                       } else {
-                               for (res = first; res <= last; res += i) {
-                                       i = i2c_smbus_read_i2c_block_data(file,
-                                               res, 32, cblock + res);
-                                       if (i <= 0) {
-                                               res = i;
-                                               break;
-                                       }
+                       for (res = first; res <= last; res += i) {
+                               i = i2c_smbus_read_i2c_block_data(file,
+                                       res, 32, cblock + res);
+                               if (i <= 0) {
+                                       res = i;
+                                       break;
                                }
                        }
                        if (res <= 0) {
@@ -376,8 +330,6 @@
                printf("     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f"
                       "    0123456789abcdef\n");
                for (i = 0; i < 256; i+=16) {
-                       if (size == I2C_SMBUS_BLOCK_DATA && i >= s_length)
-                               break;
                        if (i/16 < first/16)
                                continue;
                        if (i/16 > last/16)
@@ -415,10 +367,7 @@
                                } else
                                        res = block[i+j];
 
-                               if (size == I2C_SMBUS_BLOCK_DATA
-                                && i+j >= s_length) {
-                                       printf("   ");
-                               } else if (res < 0) {
+                               if (res < 0) {
                                        printf("XX ");
                                        if (size == I2C_SMBUS_WORD_DATA)
                                                printf("XX ");
@@ -433,9 +382,6 @@
                        printf("   ");
 
                        for (j = 0; j < 16; j++) {
-                               if (size == I2C_SMBUS_BLOCK_DATA
-                                && i+j >= s_length)
-                                       break;
                                /* Skip unwanted registers */
                                if (i+j < first || i+j > last) {
                                        printf(" ");
@@ -483,7 +429,7 @@
                        printf("\n");
                }
        }
-       if (bank && size != I2C_SMBUS_BLOCK_DATA) {
+       if (bank) {
                i2c_smbus_write_byte_data(file, bankreg, old_bank);
        }
        exit(0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cget.8 
new/i2c-tools-4.4/tools/i2cget.8
--- old/i2c-tools-4.3/tools/i2cget.8    2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cget.8    2024-10-10 15:58:45.000000000 +0200
@@ -1,4 +1,4 @@
-.TH I2CGET 8 "July 2021"
+.TH I2CGET 8 "May 2022"
 .SH "NAME"
 i2cget \- read from I2C/SMBus chip registers
 
@@ -13,6 +13,9 @@
 .br
 .B i2cget
 .B -V
+.br
+.B i2cget
+.B -h
 
 .SH DESCRIPTION
 i2cget is a small helper program to read registers visible through the I2C
@@ -23,6 +26,9 @@
 .B -V
 Display the version and exit.
 .TP
+.B -h
+Display the help and exit.
+.TP
 .B -f
 Force access to the device even if it is already busy. By default, i2cget
 will refuse to access a device which is already under the control of a
@@ -49,7 +55,7 @@
 will be read (if that makes sense for the considered chip).
 .PP
 The \fImode\fR parameter, if specified, is one of the letters \fBb\fP,
-\fBw\fP, \fBc\fP, or \fBi\fP, corresponding to a read byte data, a read
+\fBw\fP, \fBc\fP, \fBs\fP, or \fBi\fP, corresponding to a read byte data, a 
read
 word data, a write byte/read byte, an SMBus block read, or an I2C block read
 transaction, respectively. A \fBp\fP can also be appended to the \fImode\fR
 parameter to enable PEC, except for I2C block transactions. If the \fImode\fR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cget.c 
new/i2c-tools-4.4/tools/i2cget.c
--- old/i2c-tools-4.3/tools/i2cget.c    2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cget.c    2024-10-10 15:58:45.000000000 +0200
@@ -1,6 +1,6 @@
 /*
     i2cget.c - A user-space program to read an I2C register.
-    Copyright (C) 2005-2021  Jean Delvare <jdelv...@suse.de>
+    Copyright (C) 2005-2022  Jean Delvare <jdelv...@suse.de>
 
     Based on i2cset.c:
     Copyright (C) 2001-2003  Frodo Looijaard <fro...@dds.nl>, and
@@ -16,11 +16,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #include <sys/ioctl.h>
@@ -36,9 +31,7 @@
 #include "util.h"
 #include "../version.h"
 
-static void help(void) __attribute__ ((noreturn));
-
-static void help(void)
+static void __attribute__ ((noreturn)) help(int status)
 {
        fprintf(stderr,
                "Usage: i2cget [-f] [-y] [-a] I2CBUS CHIP-ADDRESS [DATA-ADDRESS 
[MODE [LENGTH]]]\n"
@@ -53,7 +46,7 @@
                "    Append p for SMBus PEC\n"
                "  LENGTH is the I2C block data length (between 1 and %d, 
default %d)\n",
                I2C_SMBUS_BLOCK_MAX, I2C_SMBUS_BLOCK_MAX);
-       exit(1);
+       exit(status);
 }
 
 static int check_funcs(int file, int size, int daddress, int pec)
@@ -180,25 +173,22 @@
        int daddress;
        char filename[20];
        int pec = 0;
-       int flags = 0;
+       int opt;
        int force = 0, yes = 0, version = 0, all_addrs = 0;
        int length;
        unsigned char block_data[I2C_SMBUS_BLOCK_MAX];
 
        /* handle (optional) flags first */
-       while (1+flags < argc && argv[1+flags][0] == '-') {
-               switch (argv[1+flags][1]) {
+       while ((opt = getopt(argc, argv, "Vafhy")) != -1) {
+               switch (opt) {
                case 'V': version = 1; break;
                case 'f': force = 1; break;
                case 'y': yes = 1; break;
                case 'a': all_addrs = 1; break;
-               default:
-                       fprintf(stderr, "Error: Unsupported option "
-                               "\"%s\"!\n", argv[1+flags]);
-                       help();
-                       exit(1);
+               case 'h':
+               case '?':
+                       help(opt == '?');
                }
-               flags++;
        }
 
        if (version) {
@@ -206,31 +196,31 @@
                exit(0);
        }
 
-       if (argc < flags + 3)
-               help();
+       if (argc < optind + 2)
+               help(1);
 
-       i2cbus = lookup_i2c_bus(argv[flags+1]);
+       i2cbus = lookup_i2c_bus(argv[optind]);
        if (i2cbus < 0)
-               help();
+               help(1);
 
-       address = parse_i2c_address(argv[flags+2], all_addrs);
+       address = parse_i2c_address(argv[optind+1], all_addrs);
        if (address < 0)
-               help();
+               help(1);
 
-       if (argc > flags + 3) {
+       if (argc > optind + 2) {
                size = I2C_SMBUS_BYTE_DATA;
-               daddress = strtol(argv[flags+3], &end, 0);
+               daddress = strtol(argv[optind+2], &end, 0);
                if (*end || daddress < 0 || daddress > 0xff) {
                        fprintf(stderr, "Error: Data address invalid!\n");
-                       help();
+                       help(1);
                }
        } else {
                size = I2C_SMBUS_BYTE;
                daddress = -1;
        }
 
-       if (argc > flags + 4) {
-               switch (argv[flags+4][0]) {
+       if (argc > optind + 3) {
+               switch (argv[optind+3][0]) {
                case 'b': size = I2C_SMBUS_BYTE_DATA; break;
                case 'w': size = I2C_SMBUS_WORD_DATA; break;
                case 'c': size = I2C_SMBUS_BYTE; break;
@@ -238,24 +228,24 @@
                case 'i': size = I2C_SMBUS_I2C_BLOCK_DATA; break;
                default:
                        fprintf(stderr, "Error: Invalid mode!\n");
-                       help();
+                       help(1);
                }
-               pec = argv[flags+4][1] == 'p';
+               pec = argv[optind+3][1] == 'p';
                if (size == I2C_SMBUS_I2C_BLOCK_DATA && pec) {
                        fprintf(stderr, "Error: PEC not supported for I2C block 
data!\n");
-                       help();
+                       help(1);
                }
        }
 
-       if (argc > flags + 5) {
+       if (argc > optind + 4) {
                if (size != I2C_SMBUS_I2C_BLOCK_DATA) {
                        fprintf(stderr, "Error: Length only valid for I2C block 
data!\n");
-                       help();
+                       help(1);
                }
-               length = strtol(argv[flags+5], &end, 0);
+               length = strtol(argv[optind+4], &end, 0);
                if (*end || length < 1 || length > I2C_SMBUS_BLOCK_MAX) {
                        fprintf(stderr, "Error: Length invalid!\n");
-                       help();
+                       help(1);
                }
        } else {
                length = I2C_SMBUS_BLOCK_MAX;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cset.8 
new/i2c-tools-4.4/tools/i2cset.8
--- old/i2c-tools-4.3/tools/i2cset.8    2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cset.8    2024-10-10 15:58:45.000000000 +0200
@@ -1,4 +1,4 @@
-.TH I2CSET 8 "October 2017"
+.TH I2CSET 8 "May 2022"
 .SH "NAME"
 i2cset \- set I2C registers
 
@@ -18,6 +18,9 @@
 .br
 .B i2cset
 .B -V
+.br
+.B i2cset
+.B -h
 
 .SH DESCRIPTION
 i2cset is a small helper program to set registers visible through the I2C
@@ -28,6 +31,9 @@
 .B -V
 Display the version and exit.
 .TP
+.B -h
+Display the help and exit.
+.TP
 .B -f
 Force access to the device even if it is already busy. By default, i2cset
 will refuse to access a device which is already under the control of a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2cset.c 
new/i2c-tools-4.4/tools/i2cset.c
--- old/i2c-tools-4.3/tools/i2cset.c    2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/i2cset.c    2024-10-10 15:58:45.000000000 +0200
@@ -2,7 +2,7 @@
     i2cset.c - A user-space program to write an I2C register.
     Copyright (C) 2001-2003  Frodo Looijaard <fro...@dds.nl>, and
                              Mark D. Studebaker <mdsxyz...@yahoo.com>
-    Copyright (C) 2004-2012  Jean Delvare <jdelv...@suse.de>
+    Copyright (C) 2004-2022  Jean Delvare <jdelv...@suse.de>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -13,11 +13,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #include <sys/ioctl.h>
@@ -33,9 +28,7 @@
 #include "util.h"
 #include "../version.h"
 
-static void help(void) __attribute__ ((noreturn));
-
-static void help(void)
+static void __attribute__ ((noreturn)) help(int status)
 {
        fprintf(stderr,
                "Usage: i2cset [-f] [-y] [-m MASK] [-r] [-a] I2CBUS 
CHIP-ADDRESS DATA-ADDRESS [VALUE] ... [MODE]\n"
@@ -48,7 +41,7 @@
                "    i (I2C block data)\n"
                "    s (SMBus block data)\n"
                "    Append p for SMBus PEC\n");
-       exit(1);
+       exit(status);
 }
 
 static int check_funcs(int file, int size, int pec)
@@ -162,31 +155,24 @@
        int value, daddress, vmask = 0;
        char filename[20];
        int pec = 0;
-       int flags = 0;
+       int opt;
        int force = 0, yes = 0, version = 0, readback = 0, all_addrs = 0;
        unsigned char block[I2C_SMBUS_BLOCK_MAX];
        int len;
 
        /* handle (optional) flags first */
-       while (1+flags < argc && argv[1+flags][0] == '-') {
-               switch (argv[1+flags][1]) {
+       while ((opt = getopt(argc, argv, "Vafhm:ry")) != -1) {
+               switch (opt) {
                case 'V': version = 1; break;
                case 'f': force = 1; break;
                case 'y': yes = 1; break;
-               case 'm':
-                       if (2+flags < argc)
-                               maskp = argv[2+flags];
-                       flags++;
-                       break;
+               case 'm': maskp = optarg; break;
                case 'r': readback = 1; break;
                case 'a': all_addrs = 1; break;
-               default:
-                       fprintf(stderr, "Error: Unsupported option "
-                               "\"%s\"!\n", argv[1+flags]);
-                       help();
-                       exit(1);
+               case 'h':
+               case '?':
+                       help(opt == '?');
                }
-               flags++;
        }
 
        if (version) {
@@ -194,33 +180,33 @@
                exit(0);
        }
 
-       if (argc < flags + 4)
-               help();
+       if (argc < optind + 3)
+               help(1);
 
-       i2cbus = lookup_i2c_bus(argv[flags+1]);
+       i2cbus = lookup_i2c_bus(argv[optind]);
        if (i2cbus < 0)
-               help();
+               help(1);
 
-       address = parse_i2c_address(argv[flags+2], all_addrs);
+       address = parse_i2c_address(argv[optind+1], all_addrs);
        if (address < 0)
-               help();
+               help(1);
 
-       daddress = strtol(argv[flags+3], &end, 0);
+       daddress = strtol(argv[optind+2], &end, 0);
        if (*end || daddress < 0 || daddress > 0xff) {
                fprintf(stderr, "Error: Data address invalid!\n");
-               help();
+               help(1);
        }
 
        /* check for command/mode */
-       if (argc == flags + 4) {
+       if (argc == optind + 3) {
                /* Implicit "c" */
                size = I2C_SMBUS_BYTE;
-       } else if (argc == flags + 5) {
+       } else if (argc == optind + 4) {
                /* "c", "cp",  or implicit "b" */
-               if (!strcmp(argv[flags+4], "c")
-                || !strcmp(argv[flags+4], "cp")) {
+               if (!strcmp(argv[optind+3], "c")
+                || !strcmp(argv[optind+3], "cp")) {
                        size = I2C_SMBUS_BYTE;
-                       pec = argv[flags+4][1] == 'p';
+                       pec = argv[optind+3][1] == 'p';
                } else {
                        size = I2C_SMBUS_BYTE_DATA;
                }
@@ -229,7 +215,7 @@
                if (strlen(argv[argc-1]) > 2
                    || (strlen(argv[argc-1]) == 2 && argv[argc-1][1] != 'p')) {
                        fprintf(stderr, "Error: Invalid mode '%s'!\n", 
argv[argc-1]);
-                       help();
+                       help(1);
                }
                switch (argv[argc-1][0]) {
                case 'b': size = I2C_SMBUS_BYTE_DATA; break;
@@ -238,25 +224,25 @@
                case 'i': size = I2C_SMBUS_I2C_BLOCK_DATA; break;
                default:
                        fprintf(stderr, "Error: Invalid mode '%s'!\n", 
argv[argc-1]);
-                       help();
+                       help(1);
                }
                pec = argv[argc-1][1] == 'p';
                if (size == I2C_SMBUS_BLOCK_DATA || size == 
I2C_SMBUS_I2C_BLOCK_DATA) {
                        if (pec && size == I2C_SMBUS_I2C_BLOCK_DATA) {
                                fprintf(stderr, "Error: PEC not supported for 
I2C block writes!\n");
-                               help();
+                               help(1);
                        }
                        if (maskp) {
                                fprintf(stderr, "Error: Mask not supported for 
block writes!\n");
-                               help();
+                               help(1);
                        }
-                       if (argc > (int)sizeof(block) + flags + 5) {
+                       if (argc > (int)sizeof(block) + optind + 4) {
                                fprintf(stderr, "Error: Too many arguments!\n");
-                               help();
+                               help(1);
                        }
-               } else if (argc != flags + 6) {
+               } else if (argc != optind + 5) {
                        fprintf(stderr, "Error: Too many arguments!\n");
-                       help();
+                       help(1);
                }
        }
 
@@ -270,28 +256,28 @@
                break;
        case I2C_SMBUS_BYTE_DATA:
        case I2C_SMBUS_WORD_DATA:
-               value = strtol(argv[flags+4], &end, 0);
+               value = strtol(argv[optind+3], &end, 0);
                if (*end || value < 0) {
                        fprintf(stderr, "Error: Data value invalid!\n");
-                       help();
+                       help(1);
                }
                if ((size == I2C_SMBUS_BYTE_DATA && value > 0xff)
                    || (size == I2C_SMBUS_WORD_DATA && value > 0xffff)) {
                        fprintf(stderr, "Error: Data value out of range!\n");
-                       help();
+                       help(1);
                }
                break;
        case I2C_SMBUS_BLOCK_DATA:
        case I2C_SMBUS_I2C_BLOCK_DATA:
-               for (len = 0; len + flags + 5 < argc; len++) {
-                       value = strtol(argv[flags + len + 4], &end, 0);
+               for (len = 0; len + optind + 4 < argc; len++) {
+                       value = strtol(argv[optind + len + 3], &end, 0);
                        if (*end || value < 0) {
                                fprintf(stderr, "Error: Data value invalid!\n");
-                               help();
+                               help(1);
                        }
                        if (value > 0xff) {
                                fprintf(stderr, "Error: Data value out of 
range!\n");
-                               help();
+                               help(1);
                        }
                        block[len] = value;
                }
@@ -306,12 +292,12 @@
                vmask = strtol(maskp, &end, 0);
                if (*end || vmask == 0) {
                        fprintf(stderr, "Error: Data value mask invalid!\n");
-                       help();
+                       help(1);
                }
                if (((size == I2C_SMBUS_BYTE || size == I2C_SMBUS_BYTE_DATA)
                     && vmask > 0xff) || vmask > 0xffff) {
                        fprintf(stderr, "Error: Data value mask out of 
range!\n");
-                       help();
+                       help(1);
                }
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2ctransfer.8 
new/i2c-tools-4.4/tools/i2ctransfer.8
--- old/i2c-tools-4.3/tools/i2ctransfer.8       2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/tools/i2ctransfer.8       2024-10-10 15:58:45.000000000 
+0200
@@ -1,13 +1,14 @@
-.TH i2ctransfer 8 "February 2017"
+.TH i2ctransfer 8 "May 2022"
 .SH "NAME"
 i2ctransfer \- send user-defined I2C messages in one transfer
 
 .SH SYNOPSIS
 .B i2ctransfer
+.RB [ -a ]
+.RB [ -b ]
 .RB [ -f ]
-.RB [ -y ]
 .RB [ -v ]
-.RB [ -a ]
+.RB [ -y ]
 .I i2cbus desc
 .RI [ data ]
 .RI [ desc
@@ -15,6 +16,9 @@
 .RI ...
 .br
 .B i2ctransfer
+.B -h
+.br
+.B i2ctransfer
 .B -V
 
 .SH DESCRIPTION
@@ -37,6 +41,16 @@
 
 .SH OPTIONS
 .TP
+.B -a
+Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. Not recommended.
+.TP
+.B -b
+Print data from read messages as binary data. Disables
+.I -v
+(verbose). Useful for piping into a pretty printing tool like
+.B hexdump
+or for redirecting into a file to be analyzed later.
+.TP
 .B -f
 Force access to the device even if it is already busy.
 By default,
@@ -48,13 +62,8 @@
 to silently write to the wrong register.
 So use at your own risk and only if you know what you're doing.
 .TP
-.B -y
-Disable interactive mode.
-By default,
-.B i2ctransfer
-will wait for a confirmation from the user before messing with the I2C bus.
-When this flag is used, it will perform the operation directly.
-This is mainly meant to be used in scripts.
+.B -h
+Display the help and exit.
 .TP
 .B -v
 Enable verbose output.
@@ -63,8 +72,13 @@
 .B -V
 Display the version and exit.
 .TP
-.B -a
-Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. Not recommended.
+.B -y
+Disable interactive mode.
+By default,
+.B i2ctransfer
+will wait for a confirmation from the user before messing with the I2C bus.
+When this flag is used, it will perform the operation directly.
+This is mainly meant to be used in scripts.
 
 .SH ARGUMENTS
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/i2ctransfer.c 
new/i2c-tools-4.4/tools/i2ctransfer.c
--- old/i2c-tools-4.3/tools/i2ctransfer.c       2021-07-22 13:10:34.000000000 
+0200
+++ new/i2c-tools-4.4/tools/i2ctransfer.c       2024-10-10 15:58:45.000000000 
+0200
@@ -38,11 +38,19 @@
 #define PRINT_READ_BUF (1 << 1)
 #define PRINT_WRITE_BUF        (1 << 2)
 #define PRINT_HEADER   (1 << 3)
+#define PRINT_BINARY   (1 << 4)
 
 static void help(void)
 {
        fprintf(stderr,
-               "Usage: i2ctransfer [-f] [-y] [-v] [-V] [-a] I2CBUS DESC [DATA] 
[DESC [DATA]]...\n"
+               "Usage: i2ctransfer [OPTIONS] I2CBUS DESC [DATA] [DESC 
[DATA]]...\n"
+               "  OPTIONS: -a allow even reserved addresses\n"
+               "           -b print read data as binary, disables -v\n"
+               "           -f force access even if address is marked used\n"
+               "           -h this help text\n"
+               "           -v verbose mode\n"
+               "           -V version info\n"
+               "           -y yes to all confirmations\n"
                "  I2CBUS is an integer or an I2C bus name\n"
                "  DESC describes the transfer in the form: 
{r|w}LENGTH[@address]\n"
                "    1) read/write-flag 2) LENGTH (range 0-65535, or '?')\n"
@@ -77,10 +85,10 @@
        return 0;
 }
 
-static void print_msgs(struct i2c_msg *msgs, __u32 nmsgs, unsigned flags)
+static void print_msgs(struct i2c_msg *msgs, __u32 nmsgs, unsigned int flags)
 {
        FILE *output = flags & PRINT_STDERR ? stderr : stdout;
-       unsigned i;
+       unsigned int i;
        __u16 j;
 
        for (i = 0; i < nmsgs; i++) {
@@ -100,12 +108,16 @@
                }
 
                if (len && print_buf) {
-                       if (flags & PRINT_HEADER)
-                               fprintf(output, ", buf ");
-                       for (j = 0; j < len - 1; j++)
-                               fprintf(output, "0x%02x ", msgs[i].buf[j]);
-                       /* Print final byte with newline */
-                       fprintf(output, "0x%02x\n", msgs[i].buf[j]);
+                       if (flags & PRINT_BINARY) {
+                               fwrite(msgs[i].buf, 1, len, output);
+                       } else {
+                               if (flags & PRINT_HEADER)
+                                       fprintf(output, ", buf ");
+                               for (j = 0; j < len - 1; j++)
+                                       fprintf(output, "0x%02x ", 
msgs[i].buf[j]);
+                               /* Print final byte with newline */
+                               fprintf(output, "0x%02x\n", msgs[i].buf[j]);
+                       }
                } else if (flags & PRINT_HEADER) {
                        fprintf(output, "\n");
                }
@@ -131,30 +143,29 @@
 int main(int argc, char *argv[])
 {
        char filename[20];
-       int i2cbus, address = -1, file, arg_idx = 1, nmsgs = 0, nmsgs_sent, i;
-       int force = 0, yes = 0, version = 0, verbose = 0, all_addrs = 0;
+       int i2cbus, address = -1, file, opt, nmsgs = 0, nmsgs_sent, i;
+       int force = 0, yes = 0, version = 0, verbose = 0, all_addrs = 0, binary 
= 0;
        struct i2c_msg msgs[I2C_RDRW_IOCTL_MAX_MSGS];
        enum parse_state state = PARSE_GET_DESC;
-       unsigned buf_idx = 0;
+       unsigned int buf_idx = 0;
 
        for (i = 0; i < I2C_RDRW_IOCTL_MAX_MSGS; i++)
                msgs[i].buf = NULL;
 
-       /* handle (optional) arg_idx first */
-       while (arg_idx < argc && argv[arg_idx][0] == '-') {
-               switch (argv[arg_idx][1]) {
-               case 'V': version = 1; break;
-               case 'v': verbose = 1; break;
+       /* handle (optional) flags first */
+       while ((opt = getopt(argc, argv, "abfhvVy")) != -1) {
+               switch (opt) {
+               case 'a': all_addrs = 1; break;
+               case 'b': binary = 1; break;
                case 'f': force = 1; break;
+               case 'v': verbose = 1; break;
+               case 'V': version = 1; break;
                case 'y': yes = 1; break;
-               case 'a': all_addrs = 1; break;
-               default:
-                       fprintf(stderr, "Error: Unsupported option \"%s\"!\n",
-                               argv[arg_idx]);
+               case '?':
+               case 'h':
                        help();
-                       exit(1);
+                       exit(opt == '?');
                }
-               arg_idx++;
        }
 
        if (version) {
@@ -162,12 +173,12 @@
                exit(0);
        }
 
-       if (arg_idx == argc) {
+       if (optind == argc) {
                help();
                exit(1);
        }
 
-       i2cbus = lookup_i2c_bus(argv[arg_idx++]);
+       i2cbus = lookup_i2c_bus(argv[optind++]);
        if (i2cbus < 0)
                exit(1);
 
@@ -175,8 +186,8 @@
        if (file < 0 || check_funcs(file))
                exit(1);
 
-       while (arg_idx < argc) {
-               char *arg_ptr = argv[arg_idx];
+       while (optind < argc) {
+               char *arg_ptr = argv[optind];
                unsigned long len, raw_data;
                __u16 flags;
                __u8 data, *buf;
@@ -311,7 +322,7 @@
                        goto err_out;
                }
 
-               arg_idx++;
+               optind++;
        }
 
        if (state != PARSE_GET_DESC || nmsgs == 0) {
@@ -321,6 +332,7 @@
 
        if (yes || confirm(filename, msgs, nmsgs)) {
                struct i2c_rdwr_ioctl_data rdwr;
+               unsigned int print_flags = PRINT_READ_BUF;
 
                rdwr.msgs = msgs;
                rdwr.nmsgs = nmsgs;
@@ -332,7 +344,12 @@
                        fprintf(stderr, "Warning: only %d/%d messages were 
sent\n", nmsgs_sent, nmsgs);
                }
 
-               print_msgs(msgs, nmsgs_sent, PRINT_READ_BUF | (verbose ? 
PRINT_HEADER | PRINT_WRITE_BUF : 0));
+               if (binary)
+                       print_flags |= PRINT_BINARY;
+               else if (verbose)
+                       print_flags |= PRINT_HEADER | PRINT_WRITE_BUF;
+
+               print_msgs(msgs, nmsgs_sent, print_flags);
        }
 
        close(file);
@@ -343,7 +360,7 @@
        exit(0);
 
  err_out_with_arg:
-       fprintf(stderr, "Error: faulty argument is '%s'\n", argv[arg_idx]);
+       fprintf(stderr, "Error: faulty argument is '%s'\n", argv[optind]);
  err_out:
        close(file);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/util.c 
new/i2c-tools-4.4/tools/util.c
--- old/i2c-tools-4.3/tools/util.c      2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/util.c      2024-10-10 15:58:45.000000000 +0200
@@ -11,11 +11,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #include <stdio.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/tools/util.h 
new/i2c-tools-4.4/tools/util.h
--- old/i2c-tools-4.3/tools/util.h      2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/tools/util.h      2024-10-10 15:58:45.000000000 +0200
@@ -11,11 +11,6 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.
 */
 
 #ifndef _UTIL_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i2c-tools-4.3/version.h new/i2c-tools-4.4/version.h
--- old/i2c-tools-4.3/version.h 2021-07-22 13:10:34.000000000 +0200
+++ new/i2c-tools-4.4/version.h 2024-10-10 15:58:45.000000000 +0200
@@ -1 +1 @@
-#define VERSION "4.3"
+#define VERSION "4.4"

Reply via email to