| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/18 07:44 | flow | patch-triage |
6mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies ad7768_triggered_buffer_alloc() in drivers/iio/adc/ad7768-1.c, which is only executed during the probe sequence of the AD7768-1 SPI ADC driver. This driver targets physical Analog Devices ADC hardware and requires dedicated physical SPI wiring, clocks, and interrupt lines. In standard virtualized environments (QEMU/GCE), no software emulation or dynamic userspace instantiation mechanism exists for this SPI device, rendering the modified code structurally unreachable for fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/18 07:44 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 6e6ddfb315700fa441eed8de0ece57875731a24a\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Sep 18 07:44:33 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c\nindex 73fb734d06b23..94e746c78cd80 100644\n--- a/drivers/iio/adc/ad7768-1.c\n+++ b/drivers/iio/adc/ad7768-1.c\n@@ -1505,12 +1505,16 @@ static int ad7768_triggered_buffer_alloc(struct iio_dev *indio_dev)\n \tif (ret)\n \t\treturn ret;\n \n+\tret = devm_iio_triggered_buffer_setup(indio_dev-\u003edev.parent, indio_dev,\n+\t\t\t\t\t \u0026iio_pollfunc_store_time,\n+\t\t\t\t\t \u0026ad7768_trigger_handler,\n+\t\t\t\t\t \u0026ad7768_buffer_ops);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tindio_dev-\u003etrig = iio_trigger_get(st-\u003etrig);\n \n-\treturn devm_iio_triggered_buffer_setup(indio_dev-\u003edev.parent, indio_dev,\n-\t\t\t\t\t \u0026iio_pollfunc_store_time,\n-\t\t\t\t\t \u0026ad7768_trigger_handler,\n-\t\t\t\t\t \u0026ad7768_buffer_ops);\n+\treturn 0;\n }\n \n static int ad7768_vcm_enable(struct regulator_dev *rdev)\n"
} |
| 2/1 | 2026/09/18 07:44 | agent | patch-evaluator |
6mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies ad7768_triggered_buffer_alloc() in drivers/iio/adc/ad7768-1.c, which is only executed during the probe sequence of the AD7768-1 SPI ADC driver. This driver targets physical Analog Devices ADC hardware and requires dedicated physical SPI wiring, clocks, and interrupt lines. In standard virtualized environments (QEMU/GCE), no software emulation or dynamic userspace instantiation mechanism exists for this SPI device, rendering the modified code structurally unreachable for fuzzing.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 6e6ddfb315700fa441eed8de0ece57875731a24a
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Sep 18 07:44:33 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c
index 73fb734d06b23..94e746c78cd80 100644
--- a/drivers/iio/adc/ad7768-1.c
+++ b/drivers/iio/adc/ad7768-1.c
@@ -1505,12 +1505,16 @@ static int ad7768_triggered_buffer_alloc(struct iio_dev *indio_dev)
if (ret)
return ret;
+ ret = devm_iio_triggered_buffer_setup(indio_dev->dev.parent, indio_dev,
+ &iio_pollfunc_store_time,
+ &ad7768_trigger_handler,
+ &ad7768_buffer_ops);
+ if (ret)
+ return ret;
+
indio_dev->trig = iio_trigger_get(st->trig);
- return devm_iio_triggered_buffer_setup(indio_dev->dev.parent, indio_dev,
- &iio_pollfunc_store_time,
- &ad7768_trigger_handler,
- &ad7768_buffer_ops);
+ return 0;
}
static int ad7768_vcm_enable(struct regulator_dev *rdev)
|
| 3/2 | 2026/09/18 07:44 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 3056 output: 41 thoughts: 492 Thoughts: **Analyzing the AD7768-1 Driver Patch** Okay, let's dive into this patch. First things first, it's touching `drivers/iio/adc/ad7768-1.c`. I see a code diff... Looks like it's a change related to the triggered buffer allocation in that driver. Specifically, the original code had the `devm_iio_triggered_buffer_setup` call *after* `iio_trigger_get`. This has been changed. They've moved the `devm_iio_triggered_buffer_setup` *before* getting the trigger and have then removed the original call. This is interesting. Looks like the trigger and buffer setup is now happening together, and they're handling errors now. I wonder what's going on with this new order? Perhaps a resource dependency issue or an error handling improvement? Seems like they are making sure the buffer is set up before attempting to get a trigger, which is generally a good practice for resource management. Now, I need to understand the AD7768-1 device itself a bit better to get the full context. I'll want to check if this is an SPI, I2C, or Platform device... time to fire up `read-file` or `grepper` and see what the driver's setup reveals! |
| 4/2 | 2026/09/18 07:44 | tool | grepper |
0mArgs:{
"Expression": "ad7768",
"PathPrefix": "drivers/iio/adc/ad7768-1.c"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 794 lines.\nUse more precise expression if possible.\n\ndrivers/iio/adc/ad7768-1.c-42-\ndrivers/iio/adc/ad7768-1.c:43:#include \u003cdt-bindings/iio/adc/adi,ad7768-1.h\u003e\ndrivers/iio/adc/ad7768-1.c-44-\n--\ndrivers/iio/adc/ad7768-1.c-126-\ndrivers/iio/adc/ad7768-1.c:127:enum ad7768_conv_mode {\ndrivers/iio/adc/ad7768-1.c-128-\tAD7768_CONTINUOUS,\n--\ndrivers/iio/adc/ad7768-1.c-134-\ndrivers/iio/adc/ad7768-1.c:135:enum ad7768_pwrmode {\ndrivers/iio/adc/ad7768-1.c-136-\tAD7768_ECO_MODE = 0,\n--\ndrivers/iio/adc/ad7768-1.c-140-\ndrivers/iio/adc/ad7768-1.c:141:enum ad7768_mclk_div {\ndrivers/iio/adc/ad7768-1.c-142-\tAD7768_MCLK_DIV_16,\n--\ndrivers/iio/adc/ad7768-1.c-147-\ndrivers/iio/adc/ad7768-1.c:148:enum ad7768_filter_type {\ndrivers/iio/adc/ad7768-1.c-149-\tAD7768_FILTER_SINC5,\n--\ndrivers/iio/adc/ad7768-1.c-154-\ndrivers/iio/adc/ad7768-1.c:155:enum ad7768_filter_regval {\ndrivers/iio/adc/ad7768-1.c-156-\tAD7768_FILTER_REGVAL_SINC5 = 0,\n--\ndrivers/iio/adc/ad7768-1.c-163-\ndrivers/iio/adc/ad7768-1.c:164:enum ad7768_scan_type {\ndrivers/iio/adc/ad7768-1.c-165-\tAD7768_SCAN_TYPE_NORMAL,\n--\ndrivers/iio/adc/ad7768-1.c=199=static const int adaq7769_gains[] = {\n--\ndrivers/iio/adc/ad7768-1.c-209-\ndrivers/iio/adc/ad7768-1.c:210:static const int ad7768_aaf_gains_bp[] = {\ndrivers/iio/adc/ad7768-1.c-211-\t[AD7768_AAF_IN1] = 10000,\t/* 1.000 */\n--\ndrivers/iio/adc/ad7768-1.c-216-/* -3dB cutoff frequency multipliers (relative to ODR) for each filter type. */\ndrivers/iio/adc/ad7768-1.c:217:static const int ad7768_filter_3db_odr_multiplier[] = {\ndrivers/iio/adc/ad7768-1.c-218-\t[AD7768_FILTER_SINC5] = 204,\t\t/* 0.204 */\n--\ndrivers/iio/adc/ad7768-1.c-223-\ndrivers/iio/adc/ad7768-1.c:224:static const int ad7768_mclk_div_rates[] = {\ndrivers/iio/adc/ad7768-1.c-225-\t16, 8, 4, 2,\n--\ndrivers/iio/adc/ad7768-1.c-227-\ndrivers/iio/adc/ad7768-1.c:228:static const int ad7768_dec_rate_values[8] = {\ndrivers/iio/adc/ad7768-1.c-229-\t8, 16, 32, 64, 128, 256, 512, 1024,\n--\ndrivers/iio/adc/ad7768-1.c-232-/* Decimation rate range for sinc3 filter */\ndrivers/iio/adc/ad7768-1.c:233:static const int ad7768_sinc3_dec_rate_range[3] = {\ndrivers/iio/adc/ad7768-1.c-234-\t32, 32, 163840,\n--\ndrivers/iio/adc/ad7768-1.c-243- */\ndrivers/iio/adc/ad7768-1.c:244:static const int ad7768_filter_regval_to_type[] = {\ndrivers/iio/adc/ad7768-1.c-245-\t[AD7768_FILTER_REGVAL_SINC5] = AD7768_FILTER_SINC5,\n--\ndrivers/iio/adc/ad7768-1.c-252-\ndrivers/iio/adc/ad7768-1.c:253:static const char * const ad7768_filter_enum[] = {\ndrivers/iio/adc/ad7768-1.c-254-\t[AD7768_FILTER_SINC5] = \"sinc5\",\n--\ndrivers/iio/adc/ad7768-1.c-259-\ndrivers/iio/adc/ad7768-1.c:260:static const struct iio_scan_type ad7768_scan_type[] = {\ndrivers/iio/adc/ad7768-1.c-261-\t[AD7768_SCAN_TYPE_NORMAL] = {\n--\ndrivers/iio/adc/ad7768-1.c-287-\ndrivers/iio/adc/ad7768-1.c:288:struct ad7768_chip_info {\ndrivers/iio/adc/ad7768-1.c-289-\tconst char *name;\n--\ndrivers/iio/adc/ad7768-1.c-300-\ndrivers/iio/adc/ad7768-1.c:301:struct ad7768_state {\ndrivers/iio/adc/ad7768-1.c-302-\tstruct spi_device *spi;\n--\ndrivers/iio/adc/ad7768-1.c-312-\tunsigned int oversampling_ratio;\ndrivers/iio/adc/ad7768-1.c:313:\tenum ad7768_filter_type filter_type;\ndrivers/iio/adc/ad7768-1.c-314-\tunsigned int samp_freq;\ndrivers/iio/adc/ad7768-1.c:315:\tunsigned int samp_freq_avail[ARRAY_SIZE(ad7768_mclk_div_rates)];\ndrivers/iio/adc/ad7768-1.c-316-\tunsigned int samp_freq_avail_len;\n--\ndrivers/iio/adc/ad7768-1.c-328-\tstruct spi_message offload_msg;\ndrivers/iio/adc/ad7768-1.c:329:\tconst struct ad7768_chip_info *chip;\ndrivers/iio/adc/ad7768-1.c-330-\tbool en_spi_sync;\n--\ndrivers/iio/adc/ad7768-1.c-345-\ndrivers/iio/adc/ad7768-1.c:346:static const struct regmap_range ad7768_regmap_rd_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-347-\tregmap_reg_range(AD7768_REG_CHIP_TYPE, AD7768_REG_CHIP_GRADE),\n--\ndrivers/iio/adc/ad7768-1.c-355-\ndrivers/iio/adc/ad7768-1.c:356:static const struct regmap_access_table ad7768_regmap_rd_table = {\ndrivers/iio/adc/ad7768-1.c:357:\t.yes_ranges = ad7768_regmap_rd_ranges,\ndrivers/iio/adc/ad7768-1.c:358:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap_rd_ranges),\ndrivers/iio/adc/ad7768-1.c-359-};\ndrivers/iio/adc/ad7768-1.c-360-\ndrivers/iio/adc/ad7768-1.c:361:static const struct regmap_range ad7768_regmap_wr_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-362-\tregmap_reg_range(AD7768_REG_SCRATCH_PAD, AD7768_REG_SCRATCH_PAD),\n--\ndrivers/iio/adc/ad7768-1.c-370-\ndrivers/iio/adc/ad7768-1.c:371:static const struct regmap_access_table ad7768_regmap_wr_table = {\ndrivers/iio/adc/ad7768-1.c:372:\t.yes_ranges = ad7768_regmap_wr_ranges,\ndrivers/iio/adc/ad7768-1.c:373:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap_wr_ranges),\ndrivers/iio/adc/ad7768-1.c-374-};\ndrivers/iio/adc/ad7768-1.c-375-\ndrivers/iio/adc/ad7768-1.c:376:static const struct regmap_config ad7768_regmap_config = {\ndrivers/iio/adc/ad7768-1.c:377:\t.name = \"ad7768-1-8\",\ndrivers/iio/adc/ad7768-1.c-378-\t.reg_bits = 8,\n--\ndrivers/iio/adc/ad7768-1.c-380-\t.read_flag_mask = BIT(6),\ndrivers/iio/adc/ad7768-1.c:381:\t.rd_table = \u0026ad7768_regmap_rd_table,\ndrivers/iio/adc/ad7768-1.c:382:\t.wr_table = \u0026ad7768_regmap_wr_table,\ndrivers/iio/adc/ad7768-1.c-383-\t.max_register = AD7768_REG_ACCESS_KEY,\n--\ndrivers/iio/adc/ad7768-1.c-387-\ndrivers/iio/adc/ad7768-1.c:388:static const struct regmap_range ad7768_regmap24_rd_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-389-\tregmap_reg_range(AD7768_REG24_ADC_DATA, AD7768_REG24_ADC_DATA),\n--\ndrivers/iio/adc/ad7768-1.c-392-\ndrivers/iio/adc/ad7768-1.c:393:static const struct regmap_access_table ad7768_regmap24_rd_table = {\ndrivers/iio/adc/ad7768-1.c:394:\t.yes_ranges = ad7768_regmap24_rd_ranges,\ndrivers/iio/adc/ad7768-1.c:395:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap24_rd_ranges),\ndrivers/iio/adc/ad7768-1.c-396-};\ndrivers/iio/adc/ad7768-1.c-397-\ndrivers/iio/adc/ad7768-1.c:398:static const struct regmap_range ad7768_regmap24_wr_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-399-\tregmap_reg_range(AD7768_REG24_COEFF_DATA, AD7768_REG24_COEFF_DATA),\n--\ndrivers/iio/adc/ad7768-1.c-401-\ndrivers/iio/adc/ad7768-1.c:402:static const struct regmap_access_table ad7768_regmap24_wr_table = {\ndrivers/iio/adc/ad7768-1.c:403:\t.yes_ranges = ad7768_regmap24_wr_ranges,\ndrivers/iio/adc/ad7768-1.c:404:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap24_wr_ranges),\ndrivers/iio/adc/ad7768-1.c-405-};\ndrivers/iio/adc/ad7768-1.c-406-\ndrivers/iio/adc/ad7768-1.c:407:static const struct regmap_config ad7768_regmap24_config = {\ndrivers/iio/adc/ad7768-1.c:408:\t.name = \"ad7768-1-24\",\ndrivers/iio/adc/ad7768-1.c-409-\t.reg_bits = 8,\n--\ndrivers/iio/adc/ad7768-1.c-411-\t.read_flag_mask = BIT(6),\ndrivers/iio/adc/ad7768-1.c:412:\t.rd_table = \u0026ad7768_regmap24_rd_table,\ndrivers/iio/adc/ad7768-1.c:413:\t.wr_table = \u0026ad7768_regmap24_wr_table,\ndrivers/iio/adc/ad7768-1.c-414-\t.max_register = AD7768_REG24_COEFF_DATA,\n--\ndrivers/iio/adc/ad7768-1.c-416-\ndrivers/iio/adc/ad7768-1.c:417:static int ad7768_send_sync_pulse(struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-418-{\n--\ndrivers/iio/adc/ad7768-1.c-437-\ndrivers/iio/adc/ad7768-1.c:438:static void ad7768_fill_samp_freq_tbl(struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-439-{\n--\ndrivers/iio/adc/ad7768-1.c-443-\tfreq_filtered = DIV_ROUND_CLOSEST(st-\u003emclk_freq, st-\u003eoversampling_ratio);\ndrivers/iio/adc/ad7768-1.c:444:\tfor (i = 0; i \u003c ARRAY_SIZE(ad7768_mclk_div_rates); i++) {\ndrivers/iio/adc/ad7768-1.c:445:\t\tsamp_freq_avail = DIV_ROUND_CLOSEST(freq_filtered, ad7768_mclk_div_rates[i]);\ndrivers/iio/adc/ad7768-1.c-446-\t\t/* Sampling frequency cannot be lower than the minimum of 50 SPS */\n--\ndrivers/iio/adc/ad7768-1.c-455-\ndrivers/iio/adc/ad7768-1.c:456:static int ad7768_set_mclk_div(struct ad7768_state *st, unsigned int mclk_div)\ndrivers/iio/adc/ad7768-1.c-457-{\n--\ndrivers/iio/adc/ad7768-1.c-473-\ndrivers/iio/adc/ad7768-1.c:474:static int ad7768_set_mode(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c:475:\t\t\t enum ad7768_conv_mode mode)\ndrivers/iio/adc/ad7768-1.c-476-{\n--\ndrivers/iio/adc/ad7768-1.c-480-\ndrivers/iio/adc/ad7768-1.c:481:static int ad7768_scan_direct(struct iio_dev *indio_dev)\ndrivers/iio/adc/ad7768-1.c-482-{\ndrivers/iio/adc/ad7768-1.c:483:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-484-\tint readval, ret;\n--\ndrivers/iio/adc/ad7768-1.c-510-\ndrivers/iio/adc/ad7768-1.c:511:static int ad7768_reg_access(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-512-\t\t\t unsigned int reg,\n--\ndrivers/iio/adc/ad7768-1.c-515-{\ndrivers/iio/adc/ad7768-1.c:516:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-517-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-523-\tif (readval) {\ndrivers/iio/adc/ad7768-1.c:524:\t\tif (regmap_check_range_table(st-\u003eregmap, reg, \u0026ad7768_regmap_rd_table))\ndrivers/iio/adc/ad7768-1.c-525-\t\t\tret = regmap_read(st-\u003eregmap, reg, readval);\ndrivers/iio/adc/ad7768-1.c-526-\ndrivers/iio/adc/ad7768-1.c:527:\t\tif (regmap_check_range_table(st-\u003eregmap24, reg, \u0026ad7768_regmap24_rd_table))\ndrivers/iio/adc/ad7768-1.c-528-\t\t\tret = regmap_read(st-\u003eregmap24, reg, readval);\n--\ndrivers/iio/adc/ad7768-1.c-530-\t} else {\ndrivers/iio/adc/ad7768-1.c:531:\t\tif (regmap_check_range_table(st-\u003eregmap, reg, \u0026ad7768_regmap_wr_table))\ndrivers/iio/adc/ad7768-1.c-532-\t\t\tret = regmap_write(st-\u003eregmap, reg, writeval);\ndrivers/iio/adc/ad7768-1.c-533-\ndrivers/iio/adc/ad7768-1.c:534:\t\tif (regmap_check_range_table(st-\u003eregmap24, reg, \u0026ad7768_regmap24_wr_table))\ndrivers/iio/adc/ad7768-1.c-535-\t\t\tret = regmap_write(st-\u003eregmap24, reg, writeval);\n--\ndrivers/iio/adc/ad7768-1.c-543-\ndrivers/iio/adc/ad7768-1.c:544:static int ad7768_fill_scale_tbl(struct iio_dev *dev)\ndrivers/iio/adc/ad7768-1.c-545-{\ndrivers/iio/adc/ad7768-1.c:546:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-547-\tconst struct iio_scan_type *scan_type;\n--\ndrivers/iio/adc/ad7768-1.c-568-\t\tif (st-\u003echip-\u003ehas_variable_aaf) {\ndrivers/iio/adc/ad7768-1.c:569:\t\t\tfract.numerator *= ad7768_aaf_gains_bp[st-\u003eaaf_gain];\ndrivers/iio/adc/ad7768-1.c-570-\t\t\tfract.denominator *= PERMYRIAD;\n--\ndrivers/iio/adc/ad7768-1.c-586-\ndrivers/iio/adc/ad7768-1.c:587:static int ad7768_set_sinc3_dec_rate(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c-588-\t\t\t\t unsigned int dec_rate)\n--\ndrivers/iio/adc/ad7768-1.c-625-\ndrivers/iio/adc/ad7768-1.c:626:static int ad7768_configure_dig_fil(struct iio_dev *dev,\ndrivers/iio/adc/ad7768-1.c:627:\t\t\t\t enum ad7768_filter_type filter_type,\ndrivers/iio/adc/ad7768-1.c-628-\t\t\t\t unsigned int dec_rate)\ndrivers/iio/adc/ad7768-1.c-629-{\ndrivers/iio/adc/ad7768-1.c:630:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-631-\tunsigned int dec_rate_idx, dig_filter_regval;\n--\ndrivers/iio/adc/ad7768-1.c-643-\t\t/* Skip decimations 8 and 16, not supported by the wideband filter */\ndrivers/iio/adc/ad7768-1.c:644:\t\tdec_rate_idx = find_closest(dec_rate, \u0026ad7768_dec_rate_values[2],\ndrivers/iio/adc/ad7768-1.c:645:\t\t\t\t\t ARRAY_SIZE(ad7768_dec_rate_values) - 2);\ndrivers/iio/adc/ad7768-1.c-646-\t\tdig_filter_regval = AD7768_DIG_FIL_FIL(AD7768_FILTER_REGVAL_WIDEBAND) |\n--\ndrivers/iio/adc/ad7768-1.c-651-\tcase AD7768_FILTER_SINC5:\ndrivers/iio/adc/ad7768-1.c:652:\t\tdec_rate_idx = find_closest(dec_rate, ad7768_dec_rate_values,\ndrivers/iio/adc/ad7768-1.c:653:\t\t\t\t\t ARRAY_SIZE(ad7768_dec_rate_values));\ndrivers/iio/adc/ad7768-1.c-654-\n--\ndrivers/iio/adc/ad7768-1.c-680-\t filter_type == AD7768_FILTER_SINC3_REJ60) {\ndrivers/iio/adc/ad7768-1.c:681:\t\tret = ad7768_set_sinc3_dec_rate(st, dec_rate);\ndrivers/iio/adc/ad7768-1.c-682-\t\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-684-\t} else {\ndrivers/iio/adc/ad7768-1.c:685:\t\tst-\u003eoversampling_ratio = ad7768_dec_rate_values[dec_rate_idx];\ndrivers/iio/adc/ad7768-1.c-686-\t}\n--\ndrivers/iio/adc/ad7768-1.c-688-\t/* Update scale table: scale values vary according to the precision */\ndrivers/iio/adc/ad7768-1.c:689:\tret = ad7768_fill_scale_tbl(dev);\ndrivers/iio/adc/ad7768-1.c-690-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-692-\ndrivers/iio/adc/ad7768-1.c:693:\tad7768_fill_samp_freq_tbl(st);\ndrivers/iio/adc/ad7768-1.c-694-\ndrivers/iio/adc/ad7768-1.c-695-\t/* A sync-in pulse is required after every configuration change */\ndrivers/iio/adc/ad7768-1.c:696:\treturn ad7768_send_sync_pulse(st);\ndrivers/iio/adc/ad7768-1.c-697-}\ndrivers/iio/adc/ad7768-1.c-698-\ndrivers/iio/adc/ad7768-1.c:699:static int ad7768_setup_pga(struct device *dev, struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-700-{\n--\ndrivers/iio/adc/ad7768-1.c-712-\ndrivers/iio/adc/ad7768-1.c:713:static int ad7768_calc_pga_gain(struct ad7768_state *st, int gain_int,\ndrivers/iio/adc/ad7768-1.c-714-\t\t\t\tint gain_fract, int precision)\n--\ndrivers/iio/adc/ad7768-1.c-724-\t\tgain_nano = DIV_ROUND_CLOSEST_ULL(gain_nano * PERMYRIAD,\ndrivers/iio/adc/ad7768-1.c:725:\t\t\t\t\t\t ad7768_aaf_gains_bp[st-\u003eaaf_gain]);\ndrivers/iio/adc/ad7768-1.c-726-\n--\ndrivers/iio/adc/ad7768-1.c-730-\ndrivers/iio/adc/ad7768-1.c:731:static int ad7768_set_pga_gain(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c-732-\t\t\t int gain_mode)\n--\ndrivers/iio/adc/ad7768-1.c-749-\ndrivers/iio/adc/ad7768-1.c:750:static int ad7768_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)\ndrivers/iio/adc/ad7768-1.c-751-{\ndrivers/iio/adc/ad7768-1.c-752-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:753:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-754-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-765-\ndrivers/iio/adc/ad7768-1.c:766:static int ad7768_gpio_direction_output(struct gpio_chip *chip,\ndrivers/iio/adc/ad7768-1.c-767-\t\t\t\t\tunsigned int offset, int value)\n--\ndrivers/iio/adc/ad7768-1.c-769-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:770:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-771-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-782-\ndrivers/iio/adc/ad7768-1.c:783:static int ad7768_gpio_get(struct gpio_chip *chip, unsigned int offset)\ndrivers/iio/adc/ad7768-1.c-784-{\ndrivers/iio/adc/ad7768-1.c-785-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:786:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-787-\tunsigned int val;\n--\ndrivers/iio/adc/ad7768-1.c-815-\ndrivers/iio/adc/ad7768-1.c:816:static int ad7768_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)\ndrivers/iio/adc/ad7768-1.c-817-{\ndrivers/iio/adc/ad7768-1.c-818-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:819:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-820-\tunsigned int val;\n--\ndrivers/iio/adc/ad7768-1.c-839-\ndrivers/iio/adc/ad7768-1.c:840:static int ad7768_gpio_init(struct iio_dev *indio_dev)\ndrivers/iio/adc/ad7768-1.c-841-{\ndrivers/iio/adc/ad7768-1.c:842:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-843-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-850-\tst-\u003egpiochip = (struct gpio_chip) {\ndrivers/iio/adc/ad7768-1.c:851:\t\t.label = \"ad7768_1_gpios\",\ndrivers/iio/adc/ad7768-1.c-852-\t\t.base = -1,\n--\ndrivers/iio/adc/ad7768-1.c-855-\t\t.can_sleep = true,\ndrivers/iio/adc/ad7768-1.c:856:\t\t.direction_input = ad7768_gpio_direction_input,\ndrivers/iio/adc/ad7768-1.c:857:\t\t.direction_output = ad7768_gpio_direction_output,\ndrivers/iio/adc/ad7768-1.c:858:\t\t.get = ad7768_gpio_get,\ndrivers/iio/adc/ad7768-1.c:859:\t\t.set = ad7768_gpio_set,\ndrivers/iio/adc/ad7768-1.c-860-\t\t.owner = THIS_MODULE,\n--\ndrivers/iio/adc/ad7768-1.c-865-\ndrivers/iio/adc/ad7768-1.c:866:static int ad7768_set_freq(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c-867-\t\t\t unsigned int freq)\n--\ndrivers/iio/adc/ad7768-1.c-875-\t/* Find the closest match for the desired sampling frequency */\ndrivers/iio/adc/ad7768-1.c:876:\tidx = find_closest_descending(mclk_div, ad7768_mclk_div_rates,\ndrivers/iio/adc/ad7768-1.c:877:\t\t\t\t ARRAY_SIZE(ad7768_mclk_div_rates));\ndrivers/iio/adc/ad7768-1.c-878-\t/* Set both the mclk_div and pwrmode */\ndrivers/iio/adc/ad7768-1.c:879:\tret = ad7768_set_mclk_div(st, idx);\ndrivers/iio/adc/ad7768-1.c-880-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-883-\tst-\u003esamp_freq = DIV_ROUND_CLOSEST(st-\u003emclk_freq,\ndrivers/iio/adc/ad7768-1.c:884:\t\t\t\t\t ad7768_mclk_div_rates[idx] * st-\u003eoversampling_ratio);\ndrivers/iio/adc/ad7768-1.c-885-\ndrivers/iio/adc/ad7768-1.c-886-\t/* A sync-in pulse is required after every configuration change */\ndrivers/iio/adc/ad7768-1.c:887:\treturn ad7768_send_sync_pulse(st);\ndrivers/iio/adc/ad7768-1.c-888-}\ndrivers/iio/adc/ad7768-1.c-889-\ndrivers/iio/adc/ad7768-1.c:890:static int ad7768_set_filter_type_attr(struct iio_dev *dev,\ndrivers/iio/adc/ad7768-1.c-891-\t\t\t\t const struct iio_chan_spec *chan,\n--\ndrivers/iio/adc/ad7768-1.c-893-{\ndrivers/iio/adc/ad7768-1.c:894:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-895-\tint ret;\ndrivers/iio/adc/ad7768-1.c-896-\ndrivers/iio/adc/ad7768-1.c:897:\tret = ad7768_configure_dig_fil(dev, filter, st-\u003eoversampling_ratio);\ndrivers/iio/adc/ad7768-1.c-898-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-901-\t/* Update sampling frequency */\ndrivers/iio/adc/ad7768-1.c:902:\treturn ad7768_set_freq(st, st-\u003esamp_freq);\ndrivers/iio/adc/ad7768-1.c-903-}\ndrivers/iio/adc/ad7768-1.c-904-\ndrivers/iio/adc/ad7768-1.c:905:static int ad7768_get_filter_type_attr(struct iio_dev *dev,\ndrivers/iio/adc/ad7768-1.c-906-\t\t\t\t const struct iio_chan_spec *chan)\ndrivers/iio/adc/ad7768-1.c-907-{\ndrivers/iio/adc/ad7768-1.c:908:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-909-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-917-\t/* From the register value, get the corresponding filter type */\ndrivers/iio/adc/ad7768-1.c:918:\treturn ad7768_filter_regval_to_type[FIELD_GET(mask, mode)];\ndrivers/iio/adc/ad7768-1.c-919-}\ndrivers/iio/adc/ad7768-1.c-920-\ndrivers/iio/adc/ad7768-1.c:921:static int ad7768_update_dec_rate(struct iio_dev *dev, unsigned int dec_rate)\ndrivers/iio/adc/ad7768-1.c-922-{\ndrivers/iio/adc/ad7768-1.c:923:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-924-\tint ret;\ndrivers/iio/adc/ad7768-1.c-925-\ndrivers/iio/adc/ad7768-1.c:926:\tret = ad7768_configure_dig_fil(dev, st-\u003efilter_type, dec_rate);\ndrivers/iio/adc/ad7768-1.c-927-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-930-\t/* Update sampling frequency */\ndrivers/iio/adc/ad7768-1.c:931:\treturn ad7768_set_freq(st, st-\u003esamp_freq);\ndrivers/iio/adc/ad7768-1.c-932-}\ndrivers/iio/adc/ad7768-1.c-933-\ndrivers/iio/adc/ad7768-1.c:934:static const struct iio_enum ad7768_filter_type_iio_enum = {\ndrivers/iio/adc/ad7768-1.c:935:\t.items = ad7768_filter_enum,\ndrivers/iio/adc/ad7768-1.c:936:\t.num_items = ARRAY_SIZE(ad7768_filter_enum),\ndrivers/iio/adc/ad7768-1.c:937:\t.set = ad7768_set_filter_type_attr,\ndrivers/iio/adc/ad7768-1.c:938:\t.get = ad7768_get_filter_type_attr,\ndrivers/iio/adc/ad7768-1.c-939-};\ndrivers/iio/adc/ad7768-1.c-940-\ndrivers/iio/adc/ad7768-1.c:941:static const struct iio_chan_spec_ext_info ad7768_ext_info[] = {\ndrivers/iio/adc/ad7768-1.c:942:\tIIO_ENUM(\"filter_type\", IIO_SHARED_BY_ALL, \u0026ad7768_filter_type_iio_enum),\ndrivers/iio/adc/ad7768-1.c:943:\tIIO_ENUM_AVAILABLE(\"filter_type\", IIO_SHARED_BY_ALL, \u0026ad7768_filter_type_iio_enum),\ndrivers/iio/adc/ad7768-1.c-944-\t{ }\n--\ndrivers/iio/adc/ad7768-1.c-957-\t.info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \\\ndrivers/iio/adc/ad7768-1.c:958:\t.ext_info = ad7768_ext_info, \\\ndrivers/iio/adc/ad7768-1.c-959-\t.indexed = 1, \\\n--\ndrivers/iio/adc/ad7768-1.c-962-\t.has_ext_scan_type = 1, \\\ndrivers/iio/adc/ad7768-1.c:963:\t.ext_scan_type = ad7768_scan_type, \\\ndrivers/iio/adc/ad7768-1.c:964:\t.num_ext_scan_type = ARRAY_SIZE(ad7768_scan_type), \\\ndrivers/iio/adc/ad7768-1.c-965-}\ndrivers/iio/adc/ad7768-1.c-966-\ndrivers/iio/adc/ad7768-1.c:967:static const struct iio_chan_spec ad7768_channels[] = {\ndrivers/iio/adc/ad7768-1.c-968-\tAD7768_CHAN(0, 0),\n--\ndrivers/iio/adc/ad7768-1.c=971=static const struct iio_chan_spec adaq776x_channels[] = {\n--\ndrivers/iio/adc/ad7768-1.c-974-\ndrivers/iio/adc/ad7768-1.c:975:static int ad7768_read_raw(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-976-\t\t\t struct iio_chan_spec const *chan,\n--\ndrivers/iio/adc/ad7768-1.c-978-{\ndrivers/iio/adc/ad7768-1.c:979:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-980-\tconst struct iio_scan_type *scan_type;\n--\ndrivers/iio/adc/ad7768-1.c-991-\ndrivers/iio/adc/ad7768-1.c:992:\t\tret = ad7768_scan_direct(indio_dev);\ndrivers/iio/adc/ad7768-1.c-993-\n--\ndrivers/iio/adc/ad7768-1.c-1011-\t\tif (st-\u003echip-\u003ehas_variable_aaf)\ndrivers/iio/adc/ad7768-1.c:1012:\t\t\ttemp = (temp * PERMYRIAD) / ad7768_aaf_gains_bp[st-\u003eaaf_gain];\ndrivers/iio/adc/ad7768-1.c-1013-\n--\ndrivers/iio/adc/ad7768-1.c-1029-\tcase IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:\ndrivers/iio/adc/ad7768-1.c:1030:\t\ttemp = st-\u003esamp_freq * ad7768_filter_3db_odr_multiplier[st-\u003efilter_type];\ndrivers/iio/adc/ad7768-1.c-1031-\t\t*val = DIV_ROUND_CLOSEST(temp, MILLI);\n--\ndrivers/iio/adc/ad7768-1.c-1038-\ndrivers/iio/adc/ad7768-1.c:1039:static int ad7768_read_avail(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1040-\t\t\t struct iio_chan_spec const *chan,\n--\ndrivers/iio/adc/ad7768-1.c-1043-{\ndrivers/iio/adc/ad7768-1.c:1044:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1045-\tunsigned int shift;\n--\ndrivers/iio/adc/ad7768-1.c-1054-\t\t st-\u003efilter_type == AD7768_FILTER_SINC3_REJ60) {\ndrivers/iio/adc/ad7768-1.c:1055:\t\t\t*vals = (int *)ad7768_sinc3_dec_rate_range;\ndrivers/iio/adc/ad7768-1.c-1056-\t\t\t*type = IIO_VAL_INT;\n--\ndrivers/iio/adc/ad7768-1.c-1060-\t\tshift = st-\u003efilter_type == AD7768_FILTER_SINC5 ? 0 : 2;\ndrivers/iio/adc/ad7768-1.c:1061:\t\t*vals = (int *)\u0026ad7768_dec_rate_values[shift];\ndrivers/iio/adc/ad7768-1.c:1062:\t\t*length = ARRAY_SIZE(ad7768_dec_rate_values) - shift;\ndrivers/iio/adc/ad7768-1.c-1063-\t\t*type = IIO_VAL_INT;\n--\ndrivers/iio/adc/ad7768-1.c-1079-\ndrivers/iio/adc/ad7768-1.c:1080:static int ad7768_write_raw_get_fmt(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1081-\t\t\t\t struct iio_chan_spec const *chan, long mask)\n--\ndrivers/iio/adc/ad7768-1.c-1090-\ndrivers/iio/adc/ad7768-1.c:1091:static int ad7768_write_raw(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1092-\t\t\t struct iio_chan_spec const *chan,\n--\ndrivers/iio/adc/ad7768-1.c-1094-{\ndrivers/iio/adc/ad7768-1.c:1095:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1096-\tconst struct iio_scan_type *scan_type;\n--\ndrivers/iio/adc/ad7768-1.c-1107-\ndrivers/iio/adc/ad7768-1.c:1108:\t\tret = ad7768_set_freq(st, val);\ndrivers/iio/adc/ad7768-1.c-1109-\t\tiio_device_release_direct(indio_dev);\n--\ndrivers/iio/adc/ad7768-1.c-1114-\ndrivers/iio/adc/ad7768-1.c:1115:\t\tret = ad7768_update_dec_rate(indio_dev, val);\ndrivers/iio/adc/ad7768-1.c-1116-\t\tiio_device_release_direct(indio_dev);\n--\ndrivers/iio/adc/ad7768-1.c-1124-\t\tif (scan_type-\u003esign == 's')\ndrivers/iio/adc/ad7768-1.c:1125:\t\t\tgain_mode = ad7768_calc_pga_gain(st, val, val2,\ndrivers/iio/adc/ad7768-1.c-1126-\t\t\t\t\t\t\t scan_type-\u003erealbits - 1);\ndrivers/iio/adc/ad7768-1.c-1127-\t\telse\ndrivers/iio/adc/ad7768-1.c:1128:\t\t\tgain_mode = ad7768_calc_pga_gain(st, val, val2,\ndrivers/iio/adc/ad7768-1.c-1129-\t\t\t\t\t\t\t scan_type-\u003erealbits);\ndrivers/iio/adc/ad7768-1.c-1130-\ndrivers/iio/adc/ad7768-1.c:1131:\t\treturn ad7768_set_pga_gain(st, gain_mode);\ndrivers/iio/adc/ad7768-1.c-1132-\t}\n--\ndrivers/iio/adc/ad7768-1.c-1137-\ndrivers/iio/adc/ad7768-1.c:1138:static int ad7768_read_label(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1139-\tconst struct iio_chan_spec *chan, char *label)\ndrivers/iio/adc/ad7768-1.c-1140-{\ndrivers/iio/adc/ad7768-1.c:1141:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1142-\n--\ndrivers/iio/adc/ad7768-1.c-1145-\ndrivers/iio/adc/ad7768-1.c:1146:static int ad7768_get_current_scan_type(const struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1147-\t\t\t\t\tconst struct iio_chan_spec *chan)\ndrivers/iio/adc/ad7768-1.c-1148-{\ndrivers/iio/adc/ad7768-1.c:1149:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1150-\n--\ndrivers/iio/adc/ad7768-1.c-1158-\ndrivers/iio/adc/ad7768-1.c:1159:static const struct iio_info ad7768_info = {\ndrivers/iio/adc/ad7768-1.c:1160:\t.read_raw = \u0026ad7768_read_raw,\ndrivers/iio/adc/ad7768-1.c:1161:\t.read_avail = \u0026ad7768_read_avail,\ndrivers/iio/adc/ad7768-1.c:1162:\t.write_raw = \u0026ad7768_write_raw,\ndrivers/iio/adc/ad7768-1.c:1163:\t.write_raw_get_fmt = \u0026ad7768_write_raw_get_fmt,\ndrivers/iio/adc/ad7768-1.c:1164:\t.read_label = ad7768_read_label,\ndrivers/iio/adc/ad7768-1.c:1165:\t.get_current_scan_type = \u0026ad7768_get_current_scan_type,\ndrivers/iio/adc/ad7768-1.c:1166:\t.debugfs_reg_access = \u0026ad7768_reg_access,\ndrivers/iio/adc/ad7768-1.c-1167-};\n--\ndrivers/iio/adc/ad7768-1.c=1169=static struct fwnode_handle *\ndrivers/iio/adc/ad7768-1.c:1170:ad7768_fwnode_find_reference_args(const struct fwnode_handle *fwnode,\ndrivers/iio/adc/ad7768-1.c-1171-\t\t\t\t const char *name, const char *nargs_prop,\n--\ndrivers/iio/adc/ad7768-1.c-1181-\ndrivers/iio/adc/ad7768-1.c:1182:static int ad7768_trigger_sources_sync_setup(struct device *dev,\ndrivers/iio/adc/ad7768-1.c-1183-\t\t\t\t\t struct fwnode_handle *fwnode,\ndrivers/iio/adc/ad7768-1.c:1184:\t\t\t\t\t struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-1185-{\n--\ndrivers/iio/adc/ad7768-1.c-1188-\tstruct fwnode_handle *ref __free(fwnode_handle) =\ndrivers/iio/adc/ad7768-1.c:1189:\t\tad7768_fwnode_find_reference_args(fwnode, \"trigger-sources\",\ndrivers/iio/adc/ad7768-1.c-1190-\t\t\t\t\t\t \"#trigger-source-cells\", 0,\n--\ndrivers/iio/adc/ad7768-1.c-1214-\ndrivers/iio/adc/ad7768-1.c:1215:static int ad7768_trigger_sources_get_sync(struct device *dev,\ndrivers/iio/adc/ad7768-1.c:1216:\t\t\t\t\t struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-1217-{\n--\ndrivers/iio/adc/ad7768-1.c-1227-\tif (fwnode_property_present(fwnode, \"trigger-sources\"))\ndrivers/iio/adc/ad7768-1.c:1228:\t\treturn ad7768_trigger_sources_sync_setup(dev, fwnode, st);\ndrivers/iio/adc/ad7768-1.c-1229-\n--\ndrivers/iio/adc/ad7768-1.c-1238-\ndrivers/iio/adc/ad7768-1.c:1239:static int ad7768_setup(struct iio_dev *indio_dev)\ndrivers/iio/adc/ad7768-1.c-1240-{\ndrivers/iio/adc/ad7768-1.c:1241:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1242-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-1268-\n\n"
} |
| 5/2 | 2026/09/18 07:44 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18461 output: 45 thoughts: 39 Thoughts: Here's a summary of my thought process, as requested: **Diving Deep into the AD7768-1 Driver** Okay, time to get my hands dirty. I'm focusing my attention on `drivers/iio/adc/ad7768-1.c`, specifically the code block between lines 1450 and 1600. I need to understand what's happening there in detail. I'm expecting this section to involve some fairly specific and possibly low-level aspects of the AD7768-1's operation. Given the surrounding code, I anticipate it will likely involve some critical aspects such as: * **Interrupt Handling/Triggering:** It's a common area for interrupt setup or configuration within these kinds of drivers. This could be where the AD7768-1 interrupts are configured to signal the completion of a conversion, or maybe even a specific event. I'll be looking to understand the logic for enabling, disabling, and handling those interrupts. * **Data Retrieval/Processing:** I’ll be checking out how the driver accesses the converted data from the AD7768-1's internal registers or buffers. This might be where the DMA (Direct Memory Access) transfers are initiated, and how the driver ensures the integrity and alignment of the data read. * **Configuration/Control:** Depending on what's defined in the previous code, there could be some control register manipulation happening in this section. Configuring the ADC's data output, any noise reduction parameters, or setting up the trigger signal, would be expected. * **Error Checking/Reporting:** This is the part where it determines any faults that occur. It would be an expected area to locate error-checking logic. Checking the status, if the conversion is working as expected. I'm ready to dig into the code and see exactly how these interactions are implemented. I'm keen to identify the key functions, data structures, and the overall flow of execution in this segment. Let's see what gems are buried within! |
| 6/2 | 2026/09/18 07:44 | tool | read-file |
0mArgs:{
"File": "drivers/iio/adc/ad7768-1.c",
"FirstLine": 1490,
"LineCount": 80
}Results: {
"Contents": "1490:\t\n1491:\tstatic int ad7768_triggered_buffer_alloc(struct iio_dev *indio_dev)\n1492:\t{\n1493:\t\tstruct ad7768_state *st = iio_priv(indio_dev);\n1494:\t\tint ret;\n1495:\t\n1496:\t\tst-\u003etrig = devm_iio_trigger_alloc(indio_dev-\u003edev.parent, \"%s-dev%d\",\n1497:\t\t\t\t\t\t indio_dev-\u003ename,\n1498:\t\t\t\t\t\t iio_device_id(indio_dev));\n1499:\t\tif (!st-\u003etrig)\n1500:\t\t\treturn -ENOMEM;\n1501:\t\n1502:\t\tst-\u003etrig-\u003eops = \u0026ad7768_trigger_ops;\n1503:\t\tiio_trigger_set_drvdata(st-\u003etrig, indio_dev);\n1504:\t\tret = devm_iio_trigger_register(indio_dev-\u003edev.parent, st-\u003etrig);\n1505:\t\tif (ret)\n1506:\t\t\treturn ret;\n1507:\t\n1508:\t\tret = devm_iio_triggered_buffer_setup(indio_dev-\u003edev.parent, indio_dev,\n1509:\t\t\t\t\t\t \u0026iio_pollfunc_store_time,\n1510:\t\t\t\t\t\t \u0026ad7768_trigger_handler,\n1511:\t\t\t\t\t\t \u0026ad7768_buffer_ops);\n1512:\t\tif (ret)\n1513:\t\t\treturn ret;\n1514:\t\n1515:\t\tindio_dev-\u003etrig = iio_trigger_get(st-\u003etrig);\n1516:\t\n1517:\t\treturn 0;\n1518:\t}\n1519:\t\n1520:\tstatic int ad7768_vcm_enable(struct regulator_dev *rdev)\n1521:\t{\n1522:\t\tstruct iio_dev *indio_dev = rdev_get_drvdata(rdev);\n1523:\t\tstruct ad7768_state *st = iio_priv(indio_dev);\n1524:\t\tint ret, regval;\n1525:\t\n1526:\t\tif (!iio_device_claim_direct(indio_dev))\n1527:\t\t\treturn -EBUSY;\n1528:\t\n1529:\t\t/* To enable, set the last selected output */\n1530:\t\tregval = AD7768_REG_ANALOG2_VCM(st-\u003evcm_output_sel + 1);\n1531:\t\tret = regmap_update_bits(st-\u003eregmap, AD7768_REG_ANALOG2,\n1532:\t\t\t\t\t AD7768_REG_ANALOG2_VCM_MSK, regval);\n1533:\t\tiio_device_release_direct(indio_dev);\n1534:\t\n1535:\t\treturn ret;\n1536:\t}\n1537:\t\n1538:\tstatic int ad7768_vcm_disable(struct regulator_dev *rdev)\n1539:\t{\n1540:\t\tstruct iio_dev *indio_dev = rdev_get_drvdata(rdev);\n1541:\t\tstruct ad7768_state *st = iio_priv(indio_dev);\n1542:\t\tint ret;\n1543:\t\n1544:\t\tif (!iio_device_claim_direct(indio_dev))\n1545:\t\t\treturn -EBUSY;\n1546:\t\n1547:\t\tret = regmap_update_bits(st-\u003eregmap, AD7768_REG_ANALOG2,\n1548:\t\t\t\t\t AD7768_REG_ANALOG2_VCM_MSK, AD7768_VCM_OFF);\n1549:\t\tiio_device_release_direct(indio_dev);\n1550:\t\n1551:\t\treturn ret;\n1552:\t}\n1553:\t\n1554:\tstatic int ad7768_vcm_is_enabled(struct regulator_dev *rdev)\n1555:\t{\n1556:\t\tstruct iio_dev *indio_dev = rdev_get_drvdata(rdev);\n1557:\t\tstruct ad7768_state *st = iio_priv(indio_dev);\n1558:\t\tint ret, val;\n1559:\t\n1560:\t\tif (!iio_device_claim_direct(indio_dev))\n1561:\t\t\treturn -EBUSY;\n1562:\t\n1563:\t\tret = regmap_read(st-\u003eregmap, AD7768_REG_ANALOG2, \u0026val);\n1564:\t\tiio_device_release_direct(indio_dev);\n1565:\t\tif (ret)\n1566:\t\t\treturn ret;\n1567:\t\n1568:\t\treturn FIELD_GET(AD7768_REG_ANALOG2_VCM_MSK, val) != AD7768_VCM_OFF;\n1569:\t}\n"
} |
| 7/2 | 2026/09/18 07:44 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20379 output: 45 thoughts: 29 Thoughts: Okay, let's dive into this. Here's my take on what I'm about to look at, assuming I'm an IIO (Industrial I/O) driver expert: **Analyzing the AD7768-1 Driver Code** Right, I'm heading into `drivers/iio/adc/ad7768-1.c`. I need to zero in on the core of this driver: the probe function and the driver declaration itself. That's where the magic begins, where the hardware and software first shake hands. I'm expecting to see the `ad7768_1_probe` function, likely responsible for initializing the device after it's been detected by the system. I'll be looking for how it handles resource allocation: what IRQs it's using, which SPI or I2C devices it's grabbing, and how it's mapping the device's registers. I want to see if they've implemented proper error handling, maybe using devm_* functions to ensure everything gets cleaned up correctly if something goes wrong during initialization. Are they using the standard IIO framework constructs like `iio_device_alloc` and `iio_device_register`? That's what I'd expect. Then, there's the driver structure declaration. This is the heart of the matter – the `ad7768_1_driver` itself. I'm keen to examine which `of_match_table` or `spi_device_id` entries they've included. Are they using Device Tree or a platform data approach? What about the module metadata and any relevant module parameters? I'm going to quickly skim the `.probe` and `.remove` function pointers. I will examine whether this is a well-structured driver, or if there's any obvious shortcutting that might cause problems down the line. I am also going to be looking at the structure that is passed to the device, which will contain any information that the device is going to use later on. My goal is to quickly assess the quality of the initial setup, ensuring it's robust, follows best practices, and integrates seamlessly with the IIO framework. A well-written probe function and driver declaration are a good sign the whole driver will be reliable. Time to get started. |
| 8/2 | 2026/09/18 07:44 | tool | read-file |
0mArgs:{
"File": "drivers/iio/adc/ad7768-1.c",
"FirstLine": 1650,
"LineCount": 80
}Results: {
"Contents": "1650:\t\n1651:\t\t/* Disable the regulator before registering it */\n1652:\t\tret = regmap_update_bits(st-\u003eregmap, AD7768_REG_ANALOG2,\n1653:\t\t\t\t\t AD7768_REG_ANALOG2_VCM_MSK, AD7768_VCM_OFF);\n1654:\t\tif (ret)\n1655:\t\t\treturn ret;\n1656:\t\n1657:\t\tst-\u003evcm_rdev = devm_regulator_register(dev, \u0026vcm_desc, \u0026config);\n1658:\t\tif (IS_ERR(st-\u003evcm_rdev))\n1659:\t\t\treturn dev_err_probe(dev, PTR_ERR(st-\u003evcm_rdev),\n1660:\t\t\t\t\t \"failed to register VCM regulator\\n\");\n1661:\t\n1662:\t\treturn 0;\n1663:\t}\n1664:\t\n1665:\tstatic int ad7768_parse_aaf_gain(struct device *dev, struct ad7768_state *st)\n1666:\t{\n1667:\t\tu32 val;\n1668:\t\tint ret;\n1669:\t\n1670:\t\tret = device_property_read_u32(dev, \"adi,aaf-gain-bp\", \u0026val);\n1671:\t\tif (ret == -EINVAL) {\n1672:\t\t\t/* If controllable, use default */\n1673:\t\t\tif (st-\u003echip-\u003ehas_variable_aaf)\n1674:\t\t\t\tst-\u003eaaf_gain = AD7768_AAF_IN1;\n1675:\t\t\treturn 0;\n1676:\t\t}\n1677:\t\tif (ret)\n1678:\t\t\treturn dev_err_probe(dev, ret, \"Failed to get AAF gain value\\n\");\n1679:\t\n1680:\t\tif (!st-\u003echip-\u003ehas_variable_aaf)\n1681:\t\t\treturn dev_err_probe(dev, -EOPNOTSUPP,\n1682:\t\t\t\t\t \"AAF gain provided, but not supported for %s\\n\", st-\u003echip-\u003ename);\n1683:\t\n1684:\t\tswitch (val) {\n1685:\t\tcase 10000:\n1686:\t\t\tst-\u003eaaf_gain = AD7768_AAF_IN1;\n1687:\t\t\tbreak;\n1688:\t\tcase 3640:\n1689:\t\t\tst-\u003eaaf_gain = AD7768_AAF_IN2;\n1690:\t\t\tbreak;\n1691:\t\tcase 1430:\n1692:\t\t\tst-\u003eaaf_gain = AD7768_AAF_IN3;\n1693:\t\t\tbreak;\n1694:\t\tdefault:\n1695:\t\t\treturn dev_err_probe(dev, -EINVAL, \"Invalid firmware provided AAF gain\\n\");\n1696:\t\t}\n1697:\t\n1698:\t\treturn 0;\n1699:\t}\n1700:\t\n1701:\tstatic bool ad7768_offload_trigger_match(struct spi_offload_trigger *trigger,\n1702:\t\t\t\t\t\t enum spi_offload_trigger_type type,\n1703:\t\t\t\t\t\t u64 *args, u32 nargs)\n1704:\t{\n1705:\t\tif (type != SPI_OFFLOAD_TRIGGER_DATA_READY)\n1706:\t\t\treturn false;\n1707:\t\n1708:\t\t/* Up to 2 args are allowed, but only 1 is used */\n1709:\t\tif (nargs == 0 || nargs \u003e 2 || args[0] != AD7768_TRIGGER_SOURCE_DRDY)\n1710:\t\t\treturn false;\n1711:\t\n1712:\t\treturn true;\n1713:\t}\n1714:\t\n1715:\tstatic int ad7768_offload_trigger_request(struct spi_offload_trigger *trigger,\n1716:\t\t\t\t\t\t enum spi_offload_trigger_type type,\n1717:\t\t\t\t\t\t u64 *args, u32 nargs)\n1718:\t{\n1719:\t\t/* Should already be validated by match, but just in case */\n1720:\t\tif (nargs == 0 || nargs \u003e 2)\n1721:\t\t\treturn -EINVAL;\n1722:\t\n1723:\t\treturn 0;\n1724:\t}\n1725:\t\n1726:\tstatic const struct spi_offload_trigger_ops ad7768_offload_trigger_ops = {\n1727:\t\t.match = ad7768_offload_trigger_match,\n1728:\t\t.request = ad7768_offload_trigger_request,\n1729:\t};\n"
} |
| 9/2 | 2026/09/18 07:44 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22233 output: 45 thoughts: 15 Thoughts: Okay, here's my attempt at summarizing the thought process, as requested, in the first person and targeted towards an expert: **Navigating the Codebase** Alright, time to dive in and finish this probe. I need to get to the end of the file. No time for preliminary work; let's get right to it. I want to trace the execution and understand the full context. Let's see if there's any important data or interesting functions. |
| 10/2 | 2026/09/18 07:44 | tool | read-file |
0mArgs:{
"File": "drivers/iio/adc/ad7768-1.c",
"FirstLine": 1730,
"LineCount": 90
}Results: {
"Contents": "1730:\t\n1731:\tstatic const struct ad7768_chip_info ad7768_chip_info = {\n1732:\t\t.name = \"ad7768-1\",\n1733:\t\t.channel_spec = ad7768_channels,\n1734:\t\t.num_channels = ARRAY_SIZE(ad7768_channels),\n1735:\t\t.has_vcm_regulator = true,\n1736:\t};\n1737:\t\n1738:\tstatic const struct ad7768_chip_info adaq7767_chip_info = {\n1739:\t\t.name = \"adaq7767-1\",\n1740:\t\t.channel_spec = ad7768_channels,\n1741:\t\t.num_channels = ARRAY_SIZE(ad7768_channels),\n1742:\t\t.has_variable_aaf = true,\n1743:\t};\n1744:\t\n1745:\tstatic const struct ad7768_chip_info adaq7768_chip_info = {\n1746:\t\t.name = \"adaq7768-1\",\n1747:\t\t.channel_spec = adaq776x_channels,\n1748:\t\t.num_channels = ARRAY_SIZE(adaq776x_channels),\n1749:\t\t.pga_gains = adaq7768_gains,\n1750:\t\t.default_pga_mode = AD7768_PGA_GAIN_2,\n1751:\t\t.num_pga_modes = ARRAY_SIZE(adaq7768_gains),\n1752:\t\t.pgia_mode2pin_offset = 6,\n1753:\t\t.has_pga = true,\n1754:\t};\n1755:\t\n1756:\tstatic const struct ad7768_chip_info adaq7769_chip_info = {\n1757:\t\t.name = \"adaq7769-1\",\n1758:\t\t.channel_spec = adaq776x_channels,\n1759:\t\t.num_channels = ARRAY_SIZE(adaq776x_channels),\n1760:\t\t.pga_gains = adaq7769_gains,\n1761:\t\t.default_pga_mode = AD7768_PGA_GAIN_0,\n1762:\t\t.num_pga_modes = ARRAY_SIZE(adaq7769_gains),\n1763:\t\t.pgia_mode2pin_offset = 0,\n1764:\t\t.has_pga = true,\n1765:\t\t.has_variable_aaf = true,\n1766:\t};\n1767:\t\n1768:\tstatic const struct spi_offload_config ad7768_spi_offload_config = {\n1769:\t\t.capability_flags = SPI_OFFLOAD_CAP_TRIGGER | SPI_OFFLOAD_CAP_RX_STREAM_DMA,\n1770:\t};\n1771:\t\n1772:\tstatic int ad7768_spi_offload_probe(struct iio_dev *indio_dev,\n1773:\t\t\t\t\t struct ad7768_state *st)\n1774:\t{\n1775:\t\tstruct device *dev = \u0026st-\u003espi-\u003edev;\n1776:\t\tstruct spi_offload_trigger_info trigger_info = {\n1777:\t\t\t.fwnode = dev_fwnode(dev),\n1778:\t\t\t.ops = \u0026ad7768_offload_trigger_ops,\n1779:\t\t\t.priv = st,\n1780:\t\t};\n1781:\t\tstruct dma_chan *rx_dma;\n1782:\t\tint ret;\n1783:\t\n1784:\t\tret = devm_spi_offload_trigger_register(dev, \u0026trigger_info);\n1785:\t\tif (ret)\n1786:\t\t\treturn dev_err_probe(dev, ret, \"failed to register offload trigger\\n\");\n1787:\t\n1788:\t\tst-\u003eoffload_trigger = devm_spi_offload_trigger_get(dev, st-\u003eoffload,\n1789:\t\t\t\t\t\t\t\t SPI_OFFLOAD_TRIGGER_DATA_READY);\n1790:\t\tif (IS_ERR(st-\u003eoffload_trigger))\n1791:\t\t\treturn dev_err_probe(dev, PTR_ERR(st-\u003eoffload_trigger),\n1792:\t\t\t\t\t \"failed to get offload trigger\\n\");\n1793:\t\n1794:\t\trx_dma = devm_spi_offload_rx_stream_request_dma_chan(dev, st-\u003eoffload);\n1795:\t\tif (IS_ERR(rx_dma))\n1796:\t\t\treturn dev_err_probe(dev, PTR_ERR(rx_dma), \"failed to get offload RX DMA\\n\");\n1797:\t\n1798:\t\tret = devm_iio_dmaengine_buffer_setup_with_handle(dev, indio_dev, rx_dma,\n1799:\t\t\t\t\t\t\t\t IIO_BUFFER_DIRECTION_IN);\n1800:\t\tif (ret)\n1801:\t\t\treturn dev_err_probe(dev, ret, \"failed to setup offload RX DMA\\n\");\n1802:\t\n1803:\t\tindio_dev-\u003esetup_ops = \u0026ad7768_offload_buffer_ops;\n1804:\t\n1805:\t\treturn 0;\n1806:\t}\n1807:\t\n1808:\tstatic int ad7768_probe(struct spi_device *spi)\n1809:\t{\n1810:\t\tstruct ad7768_state *st;\n1811:\t\tstruct iio_dev *indio_dev;\n1812:\t\tstruct device *dev = \u0026spi-\u003edev;\n1813:\t\tint ret;\n1814:\t\n1815:\t\tindio_dev = devm_iio_device_alloc(\u0026spi-\u003edev, sizeof(*st));\n1816:\t\tif (!indio_dev)\n1817:\t\t\treturn -ENOMEM;\n1818:\t\n1819:\t\tst = iio_priv(indio_dev);\n"
} |
| 11/2 | 2026/09/18 07:44 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24062 output: 45 thoughts: 14 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Diving into the `ad7768_probe` Function** Alright, time to dig deeper. That last finding piqued my interest. Let's get into the details of the `ad7768_probe` function. I need to understand exactly how this driver is initializing and setting up the AD7768. I'm especially interested in the register configurations and the communication sequences happening at this stage. Are they using the standard SPI transactions, or are there any custom extensions involved? I want to see if they are setting up the data rates correctly, handling the gain stages appropriately, and if there are any interesting workarounds implemented for any known errata. I'm also going to pay close attention to the error handling within this function; I want to see how robust the initialization is and what kind of diagnostics they have in place. Basically, I need to understand the initial state of the AD7768 as established by the driver. This is going to be my base understanding for the following investigation, as it will reveal any fundamental assumptions about the hardware or the expected operational environment. |
| 12/2 | 2026/09/18 07:44 | tool | read-file |
0mArgs:{
"File": "drivers/iio/adc/ad7768-1.c",
"FirstLine": 1820,
"LineCount": 80
}Results: {
"Contents": "1820:\t\t/*\n1821:\t\t * Datasheet recommends SDI line to be kept high when data is not being\n1822:\t\t * clocked out of the controller and the spi clock is free running,\n1823:\t\t * to prevent accidental reset.\n1824:\t\t * Since many controllers do not support the SPI_MOSI_IDLE_HIGH flag\n1825:\t\t * yet, only request the MOSI idle state to enable if the controller\n1826:\t\t * supports it.\n1827:\t\t */\n1828:\t\tif (spi-\u003econtroller-\u003emode_bits \u0026 SPI_MOSI_IDLE_HIGH) {\n1829:\t\t\tspi-\u003emode |= SPI_MOSI_IDLE_HIGH;\n1830:\t\t\tret = spi_setup(spi);\n1831:\t\t\tif (ret \u003c 0)\n1832:\t\t\t\treturn ret;\n1833:\t\t}\n1834:\t\n1835:\t\tst-\u003echip = spi_get_device_match_data(spi);\n1836:\t\tst-\u003espi = spi;\n1837:\t\n1838:\t\tst-\u003eregmap = devm_regmap_init_spi(spi, \u0026ad7768_regmap_config);\n1839:\t\tif (IS_ERR(st-\u003eregmap))\n1840:\t\t\treturn dev_err_probe(\u0026spi-\u003edev, PTR_ERR(st-\u003eregmap),\n1841:\t\t\t\t\t \"Failed to initialize regmap\");\n1842:\t\n1843:\t\tst-\u003eregmap24 = devm_regmap_init_spi(spi, \u0026ad7768_regmap24_config);\n1844:\t\tif (IS_ERR(st-\u003eregmap24))\n1845:\t\t\treturn dev_err_probe(\u0026spi-\u003edev, PTR_ERR(st-\u003eregmap24),\n1846:\t\t\t\t\t \"Failed to initialize regmap24\");\n1847:\t\n1848:\t\tret = devm_regulator_get_enable_read_voltage(\u0026spi-\u003edev, \"vref\");\n1849:\t\tif (ret \u003c 0)\n1850:\t\t\treturn dev_err_probe(\u0026spi-\u003edev, ret,\n1851:\t\t\t\t\t \"Failed to get VREF voltage\\n\");\n1852:\t\tst-\u003evref_uv = ret;\n1853:\t\n1854:\t\tst-\u003emclk = devm_clk_get_enabled(\u0026spi-\u003edev, \"mclk\");\n1855:\t\tif (IS_ERR(st-\u003emclk))\n1856:\t\t\treturn PTR_ERR(st-\u003emclk);\n1857:\t\n1858:\t\tst-\u003emclk_freq = clk_get_rate(st-\u003emclk);\n1859:\t\n1860:\t\tindio_dev-\u003echannels = st-\u003echip-\u003echannel_spec;\n1861:\t\tindio_dev-\u003enum_channels = st-\u003echip-\u003enum_channels;\n1862:\t\tindio_dev-\u003ename = st-\u003echip-\u003ename;\n1863:\t\tindio_dev-\u003einfo = \u0026ad7768_info;\n1864:\t\tindio_dev-\u003emodes = INDIO_DIRECT_MODE;\n1865:\t\n1866:\t\t/* Register VCM output regulator */\n1867:\t\tif (st-\u003echip-\u003ehas_vcm_regulator) {\n1868:\t\t\tret = ad7768_register_vcm_regulator(\u0026spi-\u003edev, st, indio_dev);\n1869:\t\t\tif (ret)\n1870:\t\t\t\treturn ret;\n1871:\t\t}\n1872:\t\n1873:\t\tret = ad7768_parse_aaf_gain(\u0026spi-\u003edev, st);\n1874:\t\tif (ret)\n1875:\t\t\treturn ret;\n1876:\t\n1877:\t\tret = ad7768_setup(indio_dev);\n1878:\t\tif (ret \u003c 0) {\n1879:\t\t\tdev_err(\u0026spi-\u003edev, \"AD7768 setup failed\\n\");\n1880:\t\t\treturn ret;\n1881:\t\t}\n1882:\t\n1883:\t\tinit_completion(\u0026st-\u003ecompletion);\n1884:\t\tret = devm_mutex_init(\u0026spi-\u003edev, \u0026st-\u003epga_lock);\n1885:\t\tif (ret)\n1886:\t\t\treturn ret;\n1887:\t\n1888:\t\tif (st-\u003echip-\u003ehas_pga) {\n1889:\t\t\tret = ad7768_setup_pga(\u0026spi-\u003edev, st);\n1890:\t\t\tif (ret)\n1891:\t\t\t\treturn ret;\n1892:\t\n1893:\t\t\tret = ad7768_set_pga_gain(st, st-\u003echip-\u003edefault_pga_mode);\n1894:\t\t\tif (ret)\n1895:\t\t\t\treturn ret;\n1896:\t\t}\n1897:\t\n1898:\t\tret = ad7768_set_channel_label(indio_dev, st-\u003echip-\u003enum_channels);\n1899:\t\tif (ret)\n"
} |
| 13/2 | 2026/09/18 07:44 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25717 output: 45 thoughts: 17 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Navigating the Probe Function** Alright, I'm diving into the `probe` function. The objective is to analyze its control flow and functionality, specifically, how it interacts with the `module_spi_driver` component. I need to understand the sequencing and interactions involved to complete my analysis. So I'll go through the probe function step-by-step, starting from the beginning. |
| 14/2 | 2026/09/18 07:45 | tool | read-file |
0mArgs:{
"File": "drivers/iio/adc/ad7768-1.c",
"FirstLine": 1900,
"LineCount": 80
}Results: {
"Contents": "1900:\t\t\treturn ret;\n1901:\t\n1902:\t\tret = devm_request_irq(\u0026spi-\u003edev, spi-\u003eirq, \u0026ad7768_interrupt,\n1903:\t\t\t\t IRQF_TRIGGER_RISING | IRQF_NO_THREAD | IRQF_NO_AUTOEN,\n1904:\t\t\t\t indio_dev-\u003ename, indio_dev);\n1905:\t\tif (ret)\n1906:\t\t\treturn ret;\n1907:\t\n1908:\t\tst-\u003eoffload = devm_spi_offload_get(dev, spi, \u0026ad7768_spi_offload_config);\n1909:\t\tret = PTR_ERR_OR_ZERO(st-\u003eoffload);\n1910:\t\tif (ret == -ENODEV) {\n1911:\t\t\t/* If not using SPI offload, fall back to low speed usage */\n1912:\t\t\tret = ad7768_triggered_buffer_alloc(indio_dev);\n1913:\t\t\tif (ret)\n1914:\t\t\t\treturn ret;\n1915:\t\t} else if (ret) {\n1916:\t\t\treturn dev_err_probe(dev, ret, \"failed to get SPI offload\\n\");\n1917:\t\t} else {\n1918:\t\t\tret = ad7768_spi_offload_probe(indio_dev, st);\n1919:\t\t\tif (ret)\n1920:\t\t\t\treturn ret;\n1921:\t\t}\n1922:\t\n1923:\t\treturn devm_iio_device_register(\u0026spi-\u003edev, indio_dev);\n1924:\t}\n1925:\t\n1926:\tstatic const struct spi_device_id ad7768_id_table[] = {\n1927:\t\t{ \"ad7768-1\", (kernel_ulong_t)\u0026ad7768_chip_info },\n1928:\t\t{ \"adaq7767-1\", (kernel_ulong_t)\u0026adaq7767_chip_info },\n1929:\t\t{ \"adaq7768-1\", (kernel_ulong_t)\u0026adaq7768_chip_info },\n1930:\t\t{ \"adaq7769-1\", (kernel_ulong_t)\u0026adaq7769_chip_info },\n1931:\t\t{ }\n1932:\t};\n1933:\tMODULE_DEVICE_TABLE(spi, ad7768_id_table);\n1934:\t\n1935:\tstatic const struct of_device_id ad7768_of_match[] = {\n1936:\t\t{ .compatible = \"adi,ad7768-1\", .data = \u0026ad7768_chip_info },\n1937:\t\t{ .compatible = \"adi,adaq7767-1\", .data = \u0026adaq7767_chip_info },\n1938:\t\t{ .compatible = \"adi,adaq7768-1\", .data = \u0026adaq7768_chip_info },\n1939:\t\t{ .compatible = \"adi,adaq7769-1\", .data = \u0026adaq7769_chip_info },\n1940:\t\t{ }\n1941:\t};\n1942:\tMODULE_DEVICE_TABLE(of, ad7768_of_match);\n1943:\t\n1944:\tstatic struct spi_driver ad7768_driver = {\n1945:\t\t.driver = {\n1946:\t\t\t.name = \"ad7768-1\",\n1947:\t\t\t.of_match_table = ad7768_of_match,\n1948:\t\t},\n1949:\t\t.probe = ad7768_probe,\n1950:\t\t.id_table = ad7768_id_table,\n1951:\t};\n1952:\tmodule_spi_driver(ad7768_driver);\n1953:\t\n1954:\tMODULE_AUTHOR(\"Stefan Popa \u003cstefan.popa@analog.com\u003e\");\n1955:\tMODULE_DESCRIPTION(\"Analog Devices AD7768-1 ADC driver\");\n1956:\tMODULE_LICENSE(\"GPL v2\");\n1957:\tMODULE_IMPORT_NS(\"IIO_DMAENGINE_BUFFER\");\n"
} |
| 15/2 | 2026/09/18 07:45 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27028 output: 47 thoughts: 27 Thoughts: Here's my take on the changes. **Diving into the Code's Recent History** Alright, let's get down to brass tacks. First things first, I need to see exactly what this patch did. Let's pull up the specific changes associated with the latest commit using `git show HEAD`. This gives me the diff, showing exactly what got added, removed, or modified. Now that I have the details of the patch, it is time to check the commit message and dig into the git log. The commit message itself will hopefully tell the story of *why* the change was made, and hopefully give me some context I can use to understand the change. The `git log` should tell me how this patch relates to the rest of the project. |
| 16/2 | 2026/09/18 07:45 | tool | grepper |
0mArgs:{
"Expression": "ad7768_triggered_buffer_alloc",
"PathPrefix": "drivers/iio/adc/ad7768-1.c"
}Results: {
"Output": "drivers/iio/adc/ad7768-1.c=1467=static int ad7768_set_channel_label(struct iio_dev *indio_dev,\n--\ndrivers/iio/adc/ad7768-1.c-1490-\ndrivers/iio/adc/ad7768-1.c:1491:static int ad7768_triggered_buffer_alloc(struct iio_dev *indio_dev)\ndrivers/iio/adc/ad7768-1.c-1492-{\n--\ndrivers/iio/adc/ad7768-1.c=1808=static int ad7768_probe(struct spi_device *spi)\n--\ndrivers/iio/adc/ad7768-1.c-1911-\t\t/* If not using SPI offload, fall back to low speed usage */\ndrivers/iio/adc/ad7768-1.c:1912:\t\tret = ad7768_triggered_buffer_alloc(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1913-\t\tif (ret)\n"
} |
| 17/2 | 2026/09/18 07:45 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27574 output: 26 thoughts: 820 Thoughts: **Analyzing the Reachability of the AD7768 ADC Driver** Okay, so I've got this driver, `drivers/iio/adc/ad7768-1.c`. It's an Analog-to-Digital Converter, and it's using the SPI bus, specifically `module_spi_driver(ad7768_driver)`. My immediate concern is whether this is something I can actually fuzz effectively. Can this driver even be instantiated or probed within a standard virtualized environment like QEMU or Google Compute Engine? A quick thought, can syzkaller even deal with this? Can SPI devices even be created for fuzzing? Wait, syzkaller doesn't have good SPI bus emulation unless I jump through hoops with spidev, spi-controller emulation or configfs, etc. Right, so how do I even create an SPI device from userspace? Can I use ACPI, Device Tree overlays, or some kind of SPI mock setup? I need to figure out how syzkaller or the kernel generally handles SPI devices, whether SPI drivers are even considered accessible or, unfortunately, structurally unreachable hardware. Right, let's go back and carefully re-read the core triage philosophy. Section 1 says reachability is the primary gate. If the code is structurally unreachable in standard virtualized environments, it shouldn't be fuzzed. Section 2 provides negative criteria - situations where I *know* I should return "WorthFuzzing=false". This includes structurally unreachable hardware like vendor-specific PCIe stuff that requires physical ASICs, or code that's only triggered by physical hot-unplugging or architecture-specific behavior. Section 3 gives positive criteria – times when I *know* it's "WorthFuzzing=true". It's all about reachable code, like core subsystems, refactorings, runtime assertions, or, importantly, reachable drivers and protocols, especially those accessible via virtual buses. Okay, so the real question is: is this SPI ADC driver *reachable*? Can I instantiate an SPI device via sysfs, ACPI, or device tree, or any other means from userspace? Does Linux even offer a mechanism for that? Time to search the kernel for SPI device instantiation or `new_device` because I2C has `/sys/bus/i2c/devices/i2c-X/new_device`. Does SPI have an equivalent `new_device`? |
| 18/2 | 2026/09/18 07:45 | tool | grepper |
0mArgs:{
"Expression": "new_device",
"PathPrefix": "drivers/spi"
}Results: {
"Output": "drivers/spi/spi-altera-dfl.c=124=static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)\n--\ndrivers/spi/spi-altera-dfl.c-174-\ndrivers/spi/spi-altera-dfl.c:175:\tif (!spi_new_device(host, \u0026board_info)) {\ndrivers/spi/spi-altera-dfl.c-176-\t\tdev_err(dev, \"%s failed to create SPI device: %s\\n\",\n--\ndrivers/spi/spi-altera-platform.c=35=static int altera_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-altera-platform.c-119-\t\tfor (i = 0; i \u003c pdata-\u003enum_devices; i++) {\ndrivers/spi/spi-altera-platform.c:120:\t\t\tif (!spi_new_device(host, pdata-\u003edevices + i))\ndrivers/spi/spi-altera-platform.c-121-\t\t\t\tdev_warn(\u0026pdev-\u003edev,\n--\ndrivers/spi/spi-butterfly.c=176=static void butterfly_attach(struct parport *p)\n--\ndrivers/spi/spi-butterfly.c-265-\tpp-\u003einfo[0].controller_data = pp;\ndrivers/spi/spi-butterfly.c:266:\tpp-\u003edataflash = spi_new_device(pp-\u003ebitbang.ctlr, \u0026pp-\u003einfo[0]);\ndrivers/spi/spi-butterfly.c-267-\tif (pp-\u003edataflash)\n--\ndrivers/spi/spi-ch341.c=141=static int ch341_probe(struct usb_interface *intf,\n--\ndrivers/spi/spi-ch341.c-206-\ndrivers/spi/spi-ch341.c:207:\tch341-\u003espidev = spi_new_device(ctrl, \u0026chip);\ndrivers/spi/spi-ch341.c-208-\tif (!ch341-\u003espidev) {\n--\ndrivers/spi/spi-cs42l43.c=313=static int cs42l43_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cs42l43.c-427-\ndrivers/spi/spi-cs42l43.c:428:\t\tif (!spi_new_device(priv-\u003ectlr, ampl_info))\ndrivers/spi/spi-cs42l43.c-429-\t\t\treturn dev_err_probe(priv-\u003edev, -ENODEV,\n--\ndrivers/spi/spi-cs42l43.c-431-\ndrivers/spi/spi-cs42l43.c:432:\t\tif (!spi_new_device(priv-\u003ectlr, ampr_info))\ndrivers/spi/spi-cs42l43.c-433-\t\t\treturn dev_err_probe(priv-\u003edev, -ENODEV,\n--\ndrivers/spi/spi-intel.c=1375=static int intel_spi_populate_chip(struct intel_spi *ispi)\n--\ndrivers/spi/spi-intel.c-1401-\ndrivers/spi/spi-intel.c:1402:\tif (!spi_new_device(ispi-\u003ehost, \u0026chip))\ndrivers/spi/spi-intel.c-1403-\t\treturn -ENODEV;\n--\ndrivers/spi/spi-intel.c-1430-\ndrivers/spi/spi-intel.c:1431:\tif (!spi_new_device(ispi-\u003ehost, \u0026chip))\ndrivers/spi/spi-intel.c-1432-\t\treturn -ENODEV;\n--\ndrivers/spi/spi-kspi2.c=310=static int kspi2_register_devices(struct kspi2 *kspi)\n--\ndrivers/spi/spi-kspi2.c-316-\tfor (i = 0; i \u003c kspi-\u003eauxdev-\u003einfo_size; i++) {\ndrivers/spi/spi-kspi2.c:317:\t\tstruct spi_device *device = spi_new_device(kspi-\u003ehost, \u0026info[i]);\ndrivers/spi/spi-kspi2.c-318-\n--\ndrivers/spi/spi-lm70llp.c=188=static void spi_lm70llp_attach(struct parport *p)\n--\ndrivers/spi/spi-lm70llp.c-266-\tpp-\u003einfo.controller_data = pp;\ndrivers/spi/spi-lm70llp.c:267:\tpp-\u003espidev_lm70 = spi_new_device(pp-\u003ebitbang.ctlr, \u0026pp-\u003einfo);\ndrivers/spi/spi-lm70llp.c-268-\tif (pp-\u003espidev_lm70)\n--\ndrivers/spi/spi-lm70llp.c-271-\telse {\ndrivers/spi/spi-lm70llp.c:272:\t\tdev_warn(\u0026pd-\u003edev, \"spi_new_device failed\\n\");\ndrivers/spi/spi-lm70llp.c-273-\t\tstatus = -ENODEV;\n--\ndrivers/spi/spi-xilinx.c=402=static int xilinx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-xilinx.c-509-\t\tfor (i = 0; i \u003c pdata-\u003enum_devices; i++)\ndrivers/spi/spi-xilinx.c:510:\t\t\tspi_new_device(host, pdata-\u003edevices + i);\ndrivers/spi/spi-xilinx.c-511-\t}\n--\ndrivers/spi/spi.c=788=EXPORT_SYMBOL_GPL(spi_add_device);\n--\ndrivers/spi/spi.c-790-/**\ndrivers/spi/spi.c:791: * spi_new_device - instantiate one new SPI device\ndrivers/spi/spi.c-792- * @ctlr: Controller to which device is connected\n--\ndrivers/spi/spi.c-803- */\ndrivers/spi/spi.c:804:struct spi_device *spi_new_device(struct spi_controller *ctlr,\ndrivers/spi/spi.c-805-\t\t\t\t struct spi_board_info *chip)\n--\ndrivers/spi/spi.c-859-}\ndrivers/spi/spi.c:860:EXPORT_SYMBOL_GPL(spi_new_device);\ndrivers/spi/spi.c-861-\n--\ndrivers/spi/spi.c=890=static void spi_match_controller_to_boardinfo(struct spi_controller *ctlr,\n--\ndrivers/spi/spi.c-897-\ndrivers/spi/spi.c:898:\tdev = spi_new_device(ctlr, bi);\ndrivers/spi/spi.c-899-\tif (!dev)\n"
} |
| 19/2 | 2026/09/18 07:45 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 30718 output: 40 thoughts: 144 Thoughts: **My SPI Sysfs Interface Investigation** Okay, so I'm diving into SPI device instantiation on Linux. Unlike I2C, which offers a neat `/sys/bus/i2c/devices/i2c-%d/new_device` interface, it looks like SPI doesn't have a direct sysfs equivalent for userspace to just spin up arbitrary devices. That's a bit surprising, I figured there'd be *something*. Let's double-check, though. Maybe I'm missing something, or maybe there is a new device attribute. I should verify if there is any mention of `new_device` in the `drivers/spi` directory. Okay, after a quick `grep`, it looks like the `spi_new_device` function is primarily used within the kernel itself, by the internal drivers for specific devices like Altera DFL, Intel SPI, Butterfly, CH341, CS42L43, and the like. This confirms my initial suspicion, but also begs the question - what's the deal with CH341? I wonder how it handles new device creation since it is an internal driver, but what's this one doing? I should dig into the `drivers/spi/spi-ch341.c` file to see if there's any clever trickery going on there. |
| 20/2 | 2026/09/18 07:45 | tool | read-file |
0mArgs:{
"File": "drivers/spi/spi-ch341.c",
"FirstLine": 200,
"LineCount": 20
}Results: {
"Contents": " 200:\t\tif (ret)\n 201:\t\t\tgoto err_kill_urb;\n 202:\t\n 203:\t\tret = spi_register_controller(ctrl);\n 204:\t\tif (ret)\n 205:\t\t\tgoto err_disable_pins;\n 206:\t\n 207:\t\tch341-\u003espidev = spi_new_device(ctrl, \u0026chip);\n 208:\t\tif (!ch341-\u003espidev) {\n 209:\t\t\tret = -ENOMEM;\n 210:\t\t\tgoto err_unregister;\n 211:\t\t}\n 212:\t\n 213:\t\treturn 0;\n 214:\t\n 215:\terr_unregister:\n 216:\t\tspi_unregister_controller(ctrl);\n 217:\terr_disable_pins:\n 218:\t\tch341_enable_pins(ch341, false);\n 219:\terr_kill_urb:\n"
} |
| 21/2 | 2026/09/18 07:45 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31460 output: 19 thoughts: 77 Thoughts: **My Initial Thoughts on SPI Driver Configuration** Okay, so I'm digging into this `spi-ch341.c` code and something immediately jumps out at me: the `chip` value is hardcoded as "spidev". That's a little… rigid, isn't it? I need to understand if this will be a problem down the line. Now, my mind wanders. Can I even instantiate the `ad7768`? Is there something in the kernel currently that's creating instances of `ad7768-1` or perhaps `adaq7767-1`? That's the next logical step. I need to quickly scan the code base to confirm there's an existing instantiation. Let's see if those device names are even *used* or referenced. |
| 22/2 | 2026/09/18 07:46 | tool | grepper |
0mArgs:{
"Expression": "ad7768"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 848 lines.\nUse more precise expression if possible.\n\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-3----\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:4:$id: http://devicetree.org/schemas/iio/adc/adi,ad7768-1.yaml#\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-5-$schema: http://devicetree.org/meta-schemas/core.yaml#\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml=12=description: |\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-14-\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:15: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7768-1.pdf\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-16- https://www.analog.com/media/en/technical-documentation/data-sheets/adaq7767-1.pdf\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml=20=properties:\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-22- enum:\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:23: - adi,ad7768-1\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-24- - adi,adaq7767-1\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-46- synchronization (SYNC_IN) pin, as an alternative to adi,sync-in-gpios.\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:47: This can be a `gpio-trigger` or another `ad7768-1` device. If the\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-48- device's own SYNC_OUT pin is internally connected to its SYNC_IN pin,\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-124- For better readability, macros for these values are available in\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:125: dt-bindings/iio/adc/adi,ad7768-1.h.\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-126- const: 1\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml=208=examples:\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-216- adc@0 {\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:217: compatible = \"adi,ad7768-1\";\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-218- reg = \u003c0\u003e;\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-228- reset-gpios = \u003c\u0026gpio 27 GPIO_ACTIVE_LOW\u003e;\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:229: clocks = \u003c\u0026ad7768_mclk\u003e;\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-230- clock-names = \"mclk\";\n--\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-241- vcm_reg: vcm-output {\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml:242: regulator-name = \"ad7768-1-vcm\";\nDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml-243- };\n--\nMAINTAINERS=1589=W:\thttps://ez.analog.com/linux-software-drivers\nMAINTAINERS:1590:F:\tDocumentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml\nMAINTAINERS:1591:F:\tdrivers/iio/adc/ad7768-1.c\nMAINTAINERS:1592:F:\tinclude/dt-bindings/iio/adc/adi,ad7768-1.h\nMAINTAINERS-1593-\n--\ndrivers/iio/adc/Kconfig=414=config AD7768_1\n--\ndrivers/iio/adc/Kconfig-429-\t To compile this driver as a module, choose M here: the module will be\ndrivers/iio/adc/Kconfig:430:\t called ad7768-1.\ndrivers/iio/adc/Kconfig-431-\n--\ndrivers/iio/adc/Makefile=40=obj-$(CONFIG_AD7766) += ad7766.o\ndrivers/iio/adc/Makefile:41:obj-$(CONFIG_AD7768_1) += ad7768-1.o\ndrivers/iio/adc/Makefile-42-obj-$(CONFIG_AD7779) += ad7779.o\n--\ndrivers/iio/adc/ad7768-1.c-42-\ndrivers/iio/adc/ad7768-1.c:43:#include \u003cdt-bindings/iio/adc/adi,ad7768-1.h\u003e\ndrivers/iio/adc/ad7768-1.c-44-\n--\ndrivers/iio/adc/ad7768-1.c-126-\ndrivers/iio/adc/ad7768-1.c:127:enum ad7768_conv_mode {\ndrivers/iio/adc/ad7768-1.c-128-\tAD7768_CONTINUOUS,\n--\ndrivers/iio/adc/ad7768-1.c-134-\ndrivers/iio/adc/ad7768-1.c:135:enum ad7768_pwrmode {\ndrivers/iio/adc/ad7768-1.c-136-\tAD7768_ECO_MODE = 0,\n--\ndrivers/iio/adc/ad7768-1.c-140-\ndrivers/iio/adc/ad7768-1.c:141:enum ad7768_mclk_div {\ndrivers/iio/adc/ad7768-1.c-142-\tAD7768_MCLK_DIV_16,\n--\ndrivers/iio/adc/ad7768-1.c-147-\ndrivers/iio/adc/ad7768-1.c:148:enum ad7768_filter_type {\ndrivers/iio/adc/ad7768-1.c-149-\tAD7768_FILTER_SINC5,\n--\ndrivers/iio/adc/ad7768-1.c-154-\ndrivers/iio/adc/ad7768-1.c:155:enum ad7768_filter_regval {\ndrivers/iio/adc/ad7768-1.c-156-\tAD7768_FILTER_REGVAL_SINC5 = 0,\n--\ndrivers/iio/adc/ad7768-1.c-163-\ndrivers/iio/adc/ad7768-1.c:164:enum ad7768_scan_type {\ndrivers/iio/adc/ad7768-1.c-165-\tAD7768_SCAN_TYPE_NORMAL,\n--\ndrivers/iio/adc/ad7768-1.c=199=static const int adaq7769_gains[] = {\n--\ndrivers/iio/adc/ad7768-1.c-209-\ndrivers/iio/adc/ad7768-1.c:210:static const int ad7768_aaf_gains_bp[] = {\ndrivers/iio/adc/ad7768-1.c-211-\t[AD7768_AAF_IN1] = 10000,\t/* 1.000 */\n--\ndrivers/iio/adc/ad7768-1.c-216-/* -3dB cutoff frequency multipliers (relative to ODR) for each filter type. */\ndrivers/iio/adc/ad7768-1.c:217:static const int ad7768_filter_3db_odr_multiplier[] = {\ndrivers/iio/adc/ad7768-1.c-218-\t[AD7768_FILTER_SINC5] = 204,\t\t/* 0.204 */\n--\ndrivers/iio/adc/ad7768-1.c-223-\ndrivers/iio/adc/ad7768-1.c:224:static const int ad7768_mclk_div_rates[] = {\ndrivers/iio/adc/ad7768-1.c-225-\t16, 8, 4, 2,\n--\ndrivers/iio/adc/ad7768-1.c-227-\ndrivers/iio/adc/ad7768-1.c:228:static const int ad7768_dec_rate_values[8] = {\ndrivers/iio/adc/ad7768-1.c-229-\t8, 16, 32, 64, 128, 256, 512, 1024,\n--\ndrivers/iio/adc/ad7768-1.c-232-/* Decimation rate range for sinc3 filter */\ndrivers/iio/adc/ad7768-1.c:233:static const int ad7768_sinc3_dec_rate_range[3] = {\ndrivers/iio/adc/ad7768-1.c-234-\t32, 32, 163840,\n--\ndrivers/iio/adc/ad7768-1.c-243- */\ndrivers/iio/adc/ad7768-1.c:244:static const int ad7768_filter_regval_to_type[] = {\ndrivers/iio/adc/ad7768-1.c-245-\t[AD7768_FILTER_REGVAL_SINC5] = AD7768_FILTER_SINC5,\n--\ndrivers/iio/adc/ad7768-1.c-252-\ndrivers/iio/adc/ad7768-1.c:253:static const char * const ad7768_filter_enum[] = {\ndrivers/iio/adc/ad7768-1.c-254-\t[AD7768_FILTER_SINC5] = \"sinc5\",\n--\ndrivers/iio/adc/ad7768-1.c-259-\ndrivers/iio/adc/ad7768-1.c:260:static const struct iio_scan_type ad7768_scan_type[] = {\ndrivers/iio/adc/ad7768-1.c-261-\t[AD7768_SCAN_TYPE_NORMAL] = {\n--\ndrivers/iio/adc/ad7768-1.c-287-\ndrivers/iio/adc/ad7768-1.c:288:struct ad7768_chip_info {\ndrivers/iio/adc/ad7768-1.c-289-\tconst char *name;\n--\ndrivers/iio/adc/ad7768-1.c-300-\ndrivers/iio/adc/ad7768-1.c:301:struct ad7768_state {\ndrivers/iio/adc/ad7768-1.c-302-\tstruct spi_device *spi;\n--\ndrivers/iio/adc/ad7768-1.c-312-\tunsigned int oversampling_ratio;\ndrivers/iio/adc/ad7768-1.c:313:\tenum ad7768_filter_type filter_type;\ndrivers/iio/adc/ad7768-1.c-314-\tunsigned int samp_freq;\ndrivers/iio/adc/ad7768-1.c:315:\tunsigned int samp_freq_avail[ARRAY_SIZE(ad7768_mclk_div_rates)];\ndrivers/iio/adc/ad7768-1.c-316-\tunsigned int samp_freq_avail_len;\n--\ndrivers/iio/adc/ad7768-1.c-328-\tstruct spi_message offload_msg;\ndrivers/iio/adc/ad7768-1.c:329:\tconst struct ad7768_chip_info *chip;\ndrivers/iio/adc/ad7768-1.c-330-\tbool en_spi_sync;\n--\ndrivers/iio/adc/ad7768-1.c-345-\ndrivers/iio/adc/ad7768-1.c:346:static const struct regmap_range ad7768_regmap_rd_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-347-\tregmap_reg_range(AD7768_REG_CHIP_TYPE, AD7768_REG_CHIP_GRADE),\n--\ndrivers/iio/adc/ad7768-1.c-355-\ndrivers/iio/adc/ad7768-1.c:356:static const struct regmap_access_table ad7768_regmap_rd_table = {\ndrivers/iio/adc/ad7768-1.c:357:\t.yes_ranges = ad7768_regmap_rd_ranges,\ndrivers/iio/adc/ad7768-1.c:358:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap_rd_ranges),\ndrivers/iio/adc/ad7768-1.c-359-};\ndrivers/iio/adc/ad7768-1.c-360-\ndrivers/iio/adc/ad7768-1.c:361:static const struct regmap_range ad7768_regmap_wr_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-362-\tregmap_reg_range(AD7768_REG_SCRATCH_PAD, AD7768_REG_SCRATCH_PAD),\n--\ndrivers/iio/adc/ad7768-1.c-370-\ndrivers/iio/adc/ad7768-1.c:371:static const struct regmap_access_table ad7768_regmap_wr_table = {\ndrivers/iio/adc/ad7768-1.c:372:\t.yes_ranges = ad7768_regmap_wr_ranges,\ndrivers/iio/adc/ad7768-1.c:373:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap_wr_ranges),\ndrivers/iio/adc/ad7768-1.c-374-};\ndrivers/iio/adc/ad7768-1.c-375-\ndrivers/iio/adc/ad7768-1.c:376:static const struct regmap_config ad7768_regmap_config = {\ndrivers/iio/adc/ad7768-1.c:377:\t.name = \"ad7768-1-8\",\ndrivers/iio/adc/ad7768-1.c-378-\t.reg_bits = 8,\n--\ndrivers/iio/adc/ad7768-1.c-380-\t.read_flag_mask = BIT(6),\ndrivers/iio/adc/ad7768-1.c:381:\t.rd_table = \u0026ad7768_regmap_rd_table,\ndrivers/iio/adc/ad7768-1.c:382:\t.wr_table = \u0026ad7768_regmap_wr_table,\ndrivers/iio/adc/ad7768-1.c-383-\t.max_register = AD7768_REG_ACCESS_KEY,\n--\ndrivers/iio/adc/ad7768-1.c-387-\ndrivers/iio/adc/ad7768-1.c:388:static const struct regmap_range ad7768_regmap24_rd_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-389-\tregmap_reg_range(AD7768_REG24_ADC_DATA, AD7768_REG24_ADC_DATA),\n--\ndrivers/iio/adc/ad7768-1.c-392-\ndrivers/iio/adc/ad7768-1.c:393:static const struct regmap_access_table ad7768_regmap24_rd_table = {\ndrivers/iio/adc/ad7768-1.c:394:\t.yes_ranges = ad7768_regmap24_rd_ranges,\ndrivers/iio/adc/ad7768-1.c:395:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap24_rd_ranges),\ndrivers/iio/adc/ad7768-1.c-396-};\ndrivers/iio/adc/ad7768-1.c-397-\ndrivers/iio/adc/ad7768-1.c:398:static const struct regmap_range ad7768_regmap24_wr_ranges[] = {\ndrivers/iio/adc/ad7768-1.c-399-\tregmap_reg_range(AD7768_REG24_COEFF_DATA, AD7768_REG24_COEFF_DATA),\n--\ndrivers/iio/adc/ad7768-1.c-401-\ndrivers/iio/adc/ad7768-1.c:402:static const struct regmap_access_table ad7768_regmap24_wr_table = {\ndrivers/iio/adc/ad7768-1.c:403:\t.yes_ranges = ad7768_regmap24_wr_ranges,\ndrivers/iio/adc/ad7768-1.c:404:\t.n_yes_ranges = ARRAY_SIZE(ad7768_regmap24_wr_ranges),\ndrivers/iio/adc/ad7768-1.c-405-};\ndrivers/iio/adc/ad7768-1.c-406-\ndrivers/iio/adc/ad7768-1.c:407:static const struct regmap_config ad7768_regmap24_config = {\ndrivers/iio/adc/ad7768-1.c:408:\t.name = \"ad7768-1-24\",\ndrivers/iio/adc/ad7768-1.c-409-\t.reg_bits = 8,\n--\ndrivers/iio/adc/ad7768-1.c-411-\t.read_flag_mask = BIT(6),\ndrivers/iio/adc/ad7768-1.c:412:\t.rd_table = \u0026ad7768_regmap24_rd_table,\ndrivers/iio/adc/ad7768-1.c:413:\t.wr_table = \u0026ad7768_regmap24_wr_table,\ndrivers/iio/adc/ad7768-1.c-414-\t.max_register = AD7768_REG24_COEFF_DATA,\n--\ndrivers/iio/adc/ad7768-1.c-416-\ndrivers/iio/adc/ad7768-1.c:417:static int ad7768_send_sync_pulse(struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-418-{\n--\ndrivers/iio/adc/ad7768-1.c-437-\ndrivers/iio/adc/ad7768-1.c:438:static void ad7768_fill_samp_freq_tbl(struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-439-{\n--\ndrivers/iio/adc/ad7768-1.c-443-\tfreq_filtered = DIV_ROUND_CLOSEST(st-\u003emclk_freq, st-\u003eoversampling_ratio);\ndrivers/iio/adc/ad7768-1.c:444:\tfor (i = 0; i \u003c ARRAY_SIZE(ad7768_mclk_div_rates); i++) {\ndrivers/iio/adc/ad7768-1.c:445:\t\tsamp_freq_avail = DIV_ROUND_CLOSEST(freq_filtered, ad7768_mclk_div_rates[i]);\ndrivers/iio/adc/ad7768-1.c-446-\t\t/* Sampling frequency cannot be lower than the minimum of 50 SPS */\n--\ndrivers/iio/adc/ad7768-1.c-455-\ndrivers/iio/adc/ad7768-1.c:456:static int ad7768_set_mclk_div(struct ad7768_state *st, unsigned int mclk_div)\ndrivers/iio/adc/ad7768-1.c-457-{\n--\ndrivers/iio/adc/ad7768-1.c-473-\ndrivers/iio/adc/ad7768-1.c:474:static int ad7768_set_mode(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c:475:\t\t\t enum ad7768_conv_mode mode)\ndrivers/iio/adc/ad7768-1.c-476-{\n--\ndrivers/iio/adc/ad7768-1.c-480-\ndrivers/iio/adc/ad7768-1.c:481:static int ad7768_scan_direct(struct iio_dev *indio_dev)\ndrivers/iio/adc/ad7768-1.c-482-{\ndrivers/iio/adc/ad7768-1.c:483:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-484-\tint readval, ret;\n--\ndrivers/iio/adc/ad7768-1.c-510-\ndrivers/iio/adc/ad7768-1.c:511:static int ad7768_reg_access(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-512-\t\t\t unsigned int reg,\n--\ndrivers/iio/adc/ad7768-1.c-515-{\ndrivers/iio/adc/ad7768-1.c:516:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-517-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-523-\tif (readval) {\ndrivers/iio/adc/ad7768-1.c:524:\t\tif (regmap_check_range_table(st-\u003eregmap, reg, \u0026ad7768_regmap_rd_table))\ndrivers/iio/adc/ad7768-1.c-525-\t\t\tret = regmap_read(st-\u003eregmap, reg, readval);\ndrivers/iio/adc/ad7768-1.c-526-\ndrivers/iio/adc/ad7768-1.c:527:\t\tif (regmap_check_range_table(st-\u003eregmap24, reg, \u0026ad7768_regmap24_rd_table))\ndrivers/iio/adc/ad7768-1.c-528-\t\t\tret = regmap_read(st-\u003eregmap24, reg, readval);\n--\ndrivers/iio/adc/ad7768-1.c-530-\t} else {\ndrivers/iio/adc/ad7768-1.c:531:\t\tif (regmap_check_range_table(st-\u003eregmap, reg, \u0026ad7768_regmap_wr_table))\ndrivers/iio/adc/ad7768-1.c-532-\t\t\tret = regmap_write(st-\u003eregmap, reg, writeval);\ndrivers/iio/adc/ad7768-1.c-533-\ndrivers/iio/adc/ad7768-1.c:534:\t\tif (regmap_check_range_table(st-\u003eregmap24, reg, \u0026ad7768_regmap24_wr_table))\ndrivers/iio/adc/ad7768-1.c-535-\t\t\tret = regmap_write(st-\u003eregmap24, reg, writeval);\n--\ndrivers/iio/adc/ad7768-1.c-543-\ndrivers/iio/adc/ad7768-1.c:544:static int ad7768_fill_scale_tbl(struct iio_dev *dev)\ndrivers/iio/adc/ad7768-1.c-545-{\ndrivers/iio/adc/ad7768-1.c:546:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-547-\tconst struct iio_scan_type *scan_type;\n--\ndrivers/iio/adc/ad7768-1.c-568-\t\tif (st-\u003echip-\u003ehas_variable_aaf) {\ndrivers/iio/adc/ad7768-1.c:569:\t\t\tfract.numerator *= ad7768_aaf_gains_bp[st-\u003eaaf_gain];\ndrivers/iio/adc/ad7768-1.c-570-\t\t\tfract.denominator *= PERMYRIAD;\n--\ndrivers/iio/adc/ad7768-1.c-586-\ndrivers/iio/adc/ad7768-1.c:587:static int ad7768_set_sinc3_dec_rate(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c-588-\t\t\t\t unsigned int dec_rate)\n--\ndrivers/iio/adc/ad7768-1.c-625-\ndrivers/iio/adc/ad7768-1.c:626:static int ad7768_configure_dig_fil(struct iio_dev *dev,\ndrivers/iio/adc/ad7768-1.c:627:\t\t\t\t enum ad7768_filter_type filter_type,\ndrivers/iio/adc/ad7768-1.c-628-\t\t\t\t unsigned int dec_rate)\ndrivers/iio/adc/ad7768-1.c-629-{\ndrivers/iio/adc/ad7768-1.c:630:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-631-\tunsigned int dec_rate_idx, dig_filter_regval;\n--\ndrivers/iio/adc/ad7768-1.c-643-\t\t/* Skip decimations 8 and 16, not supported by the wideband filter */\ndrivers/iio/adc/ad7768-1.c:644:\t\tdec_rate_idx = find_closest(dec_rate, \u0026ad7768_dec_rate_values[2],\ndrivers/iio/adc/ad7768-1.c:645:\t\t\t\t\t ARRAY_SIZE(ad7768_dec_rate_values) - 2);\ndrivers/iio/adc/ad7768-1.c-646-\t\tdig_filter_regval = AD7768_DIG_FIL_FIL(AD7768_FILTER_REGVAL_WIDEBAND) |\n--\ndrivers/iio/adc/ad7768-1.c-651-\tcase AD7768_FILTER_SINC5:\ndrivers/iio/adc/ad7768-1.c:652:\t\tdec_rate_idx = find_closest(dec_rate, ad7768_dec_rate_values,\ndrivers/iio/adc/ad7768-1.c:653:\t\t\t\t\t ARRAY_SIZE(ad7768_dec_rate_values));\ndrivers/iio/adc/ad7768-1.c-654-\n--\ndrivers/iio/adc/ad7768-1.c-680-\t filter_type == AD7768_FILTER_SINC3_REJ60) {\ndrivers/iio/adc/ad7768-1.c:681:\t\tret = ad7768_set_sinc3_dec_rate(st, dec_rate);\ndrivers/iio/adc/ad7768-1.c-682-\t\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-684-\t} else {\ndrivers/iio/adc/ad7768-1.c:685:\t\tst-\u003eoversampling_ratio = ad7768_dec_rate_values[dec_rate_idx];\ndrivers/iio/adc/ad7768-1.c-686-\t}\n--\ndrivers/iio/adc/ad7768-1.c-688-\t/* Update scale table: scale values vary according to the precision */\ndrivers/iio/adc/ad7768-1.c:689:\tret = ad7768_fill_scale_tbl(dev);\ndrivers/iio/adc/ad7768-1.c-690-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-692-\ndrivers/iio/adc/ad7768-1.c:693:\tad7768_fill_samp_freq_tbl(st);\ndrivers/iio/adc/ad7768-1.c-694-\ndrivers/iio/adc/ad7768-1.c-695-\t/* A sync-in pulse is required after every configuration change */\ndrivers/iio/adc/ad7768-1.c:696:\treturn ad7768_send_sync_pulse(st);\ndrivers/iio/adc/ad7768-1.c-697-}\ndrivers/iio/adc/ad7768-1.c-698-\ndrivers/iio/adc/ad7768-1.c:699:static int ad7768_setup_pga(struct device *dev, struct ad7768_state *st)\ndrivers/iio/adc/ad7768-1.c-700-{\n--\ndrivers/iio/adc/ad7768-1.c-712-\ndrivers/iio/adc/ad7768-1.c:713:static int ad7768_calc_pga_gain(struct ad7768_state *st, int gain_int,\ndrivers/iio/adc/ad7768-1.c-714-\t\t\t\tint gain_fract, int precision)\n--\ndrivers/iio/adc/ad7768-1.c-724-\t\tgain_nano = DIV_ROUND_CLOSEST_ULL(gain_nano * PERMYRIAD,\ndrivers/iio/adc/ad7768-1.c:725:\t\t\t\t\t\t ad7768_aaf_gains_bp[st-\u003eaaf_gain]);\ndrivers/iio/adc/ad7768-1.c-726-\n--\ndrivers/iio/adc/ad7768-1.c-730-\ndrivers/iio/adc/ad7768-1.c:731:static int ad7768_set_pga_gain(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c-732-\t\t\t int gain_mode)\n--\ndrivers/iio/adc/ad7768-1.c-749-\ndrivers/iio/adc/ad7768-1.c:750:static int ad7768_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)\ndrivers/iio/adc/ad7768-1.c-751-{\ndrivers/iio/adc/ad7768-1.c-752-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:753:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-754-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-765-\ndrivers/iio/adc/ad7768-1.c:766:static int ad7768_gpio_direction_output(struct gpio_chip *chip,\ndrivers/iio/adc/ad7768-1.c-767-\t\t\t\t\tunsigned int offset, int value)\n--\ndrivers/iio/adc/ad7768-1.c-769-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:770:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-771-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-782-\ndrivers/iio/adc/ad7768-1.c:783:static int ad7768_gpio_get(struct gpio_chip *chip, unsigned int offset)\ndrivers/iio/adc/ad7768-1.c-784-{\ndrivers/iio/adc/ad7768-1.c-785-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:786:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-787-\tunsigned int val;\n--\ndrivers/iio/adc/ad7768-1.c-815-\ndrivers/iio/adc/ad7768-1.c:816:static int ad7768_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)\ndrivers/iio/adc/ad7768-1.c-817-{\ndrivers/iio/adc/ad7768-1.c-818-\tstruct iio_dev *indio_dev = gpiochip_get_data(chip);\ndrivers/iio/adc/ad7768-1.c:819:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-820-\tunsigned int val;\n--\ndrivers/iio/adc/ad7768-1.c-839-\ndrivers/iio/adc/ad7768-1.c:840:static int ad7768_gpio_init(struct iio_dev *indio_dev)\ndrivers/iio/adc/ad7768-1.c-841-{\ndrivers/iio/adc/ad7768-1.c:842:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-843-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-850-\tst-\u003egpiochip = (struct gpio_chip) {\ndrivers/iio/adc/ad7768-1.c:851:\t\t.label = \"ad7768_1_gpios\",\ndrivers/iio/adc/ad7768-1.c-852-\t\t.base = -1,\n--\ndrivers/iio/adc/ad7768-1.c-855-\t\t.can_sleep = true,\ndrivers/iio/adc/ad7768-1.c:856:\t\t.direction_input = ad7768_gpio_direction_input,\ndrivers/iio/adc/ad7768-1.c:857:\t\t.direction_output = ad7768_gpio_direction_output,\ndrivers/iio/adc/ad7768-1.c:858:\t\t.get = ad7768_gpio_get,\ndrivers/iio/adc/ad7768-1.c:859:\t\t.set = ad7768_gpio_set,\ndrivers/iio/adc/ad7768-1.c-860-\t\t.owner = THIS_MODULE,\n--\ndrivers/iio/adc/ad7768-1.c-865-\ndrivers/iio/adc/ad7768-1.c:866:static int ad7768_set_freq(struct ad7768_state *st,\ndrivers/iio/adc/ad7768-1.c-867-\t\t\t unsigned int freq)\n--\ndrivers/iio/adc/ad7768-1.c-875-\t/* Find the closest match for the desired sampling frequency */\ndrivers/iio/adc/ad7768-1.c:876:\tidx = find_closest_descending(mclk_div, ad7768_mclk_div_rates,\ndrivers/iio/adc/ad7768-1.c:877:\t\t\t\t ARRAY_SIZE(ad7768_mclk_div_rates));\ndrivers/iio/adc/ad7768-1.c-878-\t/* Set both the mclk_div and pwrmode */\ndrivers/iio/adc/ad7768-1.c:879:\tret = ad7768_set_mclk_div(st, idx);\ndrivers/iio/adc/ad7768-1.c-880-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-883-\tst-\u003esamp_freq = DIV_ROUND_CLOSEST(st-\u003emclk_freq,\ndrivers/iio/adc/ad7768-1.c:884:\t\t\t\t\t ad7768_mclk_div_rates[idx] * st-\u003eoversampling_ratio);\ndrivers/iio/adc/ad7768-1.c-885-\ndrivers/iio/adc/ad7768-1.c-886-\t/* A sync-in pulse is required after every configuration change */\ndrivers/iio/adc/ad7768-1.c:887:\treturn ad7768_send_sync_pulse(st);\ndrivers/iio/adc/ad7768-1.c-888-}\ndrivers/iio/adc/ad7768-1.c-889-\ndrivers/iio/adc/ad7768-1.c:890:static int ad7768_set_filter_type_attr(struct iio_dev *dev,\ndrivers/iio/adc/ad7768-1.c-891-\t\t\t\t const struct iio_chan_spec *chan,\n--\ndrivers/iio/adc/ad7768-1.c-893-{\ndrivers/iio/adc/ad7768-1.c:894:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-895-\tint ret;\ndrivers/iio/adc/ad7768-1.c-896-\ndrivers/iio/adc/ad7768-1.c:897:\tret = ad7768_configure_dig_fil(dev, filter, st-\u003eoversampling_ratio);\ndrivers/iio/adc/ad7768-1.c-898-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-901-\t/* Update sampling frequency */\ndrivers/iio/adc/ad7768-1.c:902:\treturn ad7768_set_freq(st, st-\u003esamp_freq);\ndrivers/iio/adc/ad7768-1.c-903-}\ndrivers/iio/adc/ad7768-1.c-904-\ndrivers/iio/adc/ad7768-1.c:905:static int ad7768_get_filter_type_attr(struct iio_dev *dev,\ndrivers/iio/adc/ad7768-1.c-906-\t\t\t\t const struct iio_chan_spec *chan)\ndrivers/iio/adc/ad7768-1.c-907-{\ndrivers/iio/adc/ad7768-1.c:908:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-909-\tint ret;\n--\ndrivers/iio/adc/ad7768-1.c-917-\t/* From the register value, get the corresponding filter type */\ndrivers/iio/adc/ad7768-1.c:918:\treturn ad7768_filter_regval_to_type[FIELD_GET(mask, mode)];\ndrivers/iio/adc/ad7768-1.c-919-}\ndrivers/iio/adc/ad7768-1.c-920-\ndrivers/iio/adc/ad7768-1.c:921:static int ad7768_update_dec_rate(struct iio_dev *dev, unsigned int dec_rate)\ndrivers/iio/adc/ad7768-1.c-922-{\ndrivers/iio/adc/ad7768-1.c:923:\tstruct ad7768_state *st = iio_priv(dev);\ndrivers/iio/adc/ad7768-1.c-924-\tint ret;\ndrivers/iio/adc/ad7768-1.c-925-\ndrivers/iio/adc/ad7768-1.c:926:\tret = ad7768_configure_dig_fil(dev, st-\u003efilter_type, dec_rate);\ndrivers/iio/adc/ad7768-1.c-927-\tif (ret)\n--\ndrivers/iio/adc/ad7768-1.c-930-\t/* Update sampling frequency */\ndrivers/iio/adc/ad7768-1.c:931:\treturn ad7768_set_freq(st, st-\u003esamp_freq);\ndrivers/iio/adc/ad7768-1.c-932-}\ndrivers/iio/adc/ad7768-1.c-933-\ndrivers/iio/adc/ad7768-1.c:934:static const struct iio_enum ad7768_filter_type_iio_enum = {\ndrivers/iio/adc/ad7768-1.c:935:\t.items = ad7768_filter_enum,\ndrivers/iio/adc/ad7768-1.c:936:\t.num_items = ARRAY_SIZE(ad7768_filter_enum),\ndrivers/iio/adc/ad7768-1.c:937:\t.set = ad7768_set_filter_type_attr,\ndrivers/iio/adc/ad7768-1.c:938:\t.get = ad7768_get_filter_type_attr,\ndrivers/iio/adc/ad7768-1.c-939-};\ndrivers/iio/adc/ad7768-1.c-940-\ndrivers/iio/adc/ad7768-1.c:941:static const struct iio_chan_spec_ext_info ad7768_ext_info[] = {\ndrivers/iio/adc/ad7768-1.c:942:\tIIO_ENUM(\"filter_type\", IIO_SHARED_BY_ALL, \u0026ad7768_filter_type_iio_enum),\ndrivers/iio/adc/ad7768-1.c:943:\tIIO_ENUM_AVAILABLE(\"filter_type\", IIO_SHARED_BY_ALL, \u0026ad7768_filter_type_iio_enum),\ndrivers/iio/adc/ad7768-1.c-944-\t{ }\n--\ndrivers/iio/adc/ad7768-1.c-957-\t.info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \\\ndrivers/iio/adc/ad7768-1.c:958:\t.ext_info = ad7768_ext_info, \\\ndrivers/iio/adc/ad7768-1.c-959-\t.indexed = 1, \\\n--\ndrivers/iio/adc/ad7768-1.c-962-\t.has_ext_scan_type = 1, \\\ndrivers/iio/adc/ad7768-1.c:963:\t.ext_scan_type = ad7768_scan_type, \\\ndrivers/iio/adc/ad7768-1.c:964:\t.num_ext_scan_type = ARRAY_SIZE(ad7768_scan_type), \\\ndrivers/iio/adc/ad7768-1.c-965-}\ndrivers/iio/adc/ad7768-1.c-966-\ndrivers/iio/adc/ad7768-1.c:967:static const struct iio_chan_spec ad7768_channels[] = {\ndrivers/iio/adc/ad7768-1.c-968-\tAD7768_CHAN(0, 0),\n--\ndrivers/iio/adc/ad7768-1.c=971=static const struct iio_chan_spec adaq776x_channels[] = {\n--\ndrivers/iio/adc/ad7768-1.c-974-\ndrivers/iio/adc/ad7768-1.c:975:static int ad7768_read_raw(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-976-\t\t\t struct iio_chan_spec const *chan,\n--\ndrivers/iio/adc/ad7768-1.c-978-{\ndrivers/iio/adc/ad7768-1.c:979:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-980-\tconst struct iio_scan_type *scan_type;\n--\ndrivers/iio/adc/ad7768-1.c-991-\ndrivers/iio/adc/ad7768-1.c:992:\t\tret = ad7768_scan_direct(indio_dev);\ndrivers/iio/adc/ad7768-1.c-993-\n--\ndrivers/iio/adc/ad7768-1.c-1011-\t\tif (st-\u003echip-\u003ehas_variable_aaf)\ndrivers/iio/adc/ad7768-1.c:1012:\t\t\ttemp = (temp * PERMYRIAD) / ad7768_aaf_gains_bp[st-\u003eaaf_gain];\ndrivers/iio/adc/ad7768-1.c-1013-\n--\ndrivers/iio/adc/ad7768-1.c-1029-\tcase IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:\ndrivers/iio/adc/ad7768-1.c:1030:\t\ttemp = st-\u003esamp_freq * ad7768_filter_3db_odr_multiplier[st-\u003efilter_type];\ndrivers/iio/adc/ad7768-1.c-1031-\t\t*val = DIV_ROUND_CLOSEST(temp, MILLI);\n--\ndrivers/iio/adc/ad7768-1.c-1038-\ndrivers/iio/adc/ad7768-1.c:1039:static int ad7768_read_avail(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1040-\t\t\t struct iio_chan_spec const *chan,\n--\ndrivers/iio/adc/ad7768-1.c-1043-{\ndrivers/iio/adc/ad7768-1.c:1044:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1045-\tunsigned int shift;\n--\ndrivers/iio/adc/ad7768-1.c-1054-\t\t st-\u003efilter_type == AD7768_FILTER_SINC3_REJ60) {\ndrivers/iio/adc/ad7768-1.c:1055:\t\t\t*vals = (int *)ad7768_sinc3_dec_rate_range;\ndrivers/iio/adc/ad7768-1.c-1056-\t\t\t*type = IIO_VAL_INT;\n--\ndrivers/iio/adc/ad7768-1.c-1060-\t\tshift = st-\u003efilter_type == AD7768_FILTER_SINC5 ? 0 : 2;\ndrivers/iio/adc/ad7768-1.c:1061:\t\t*vals = (int *)\u0026ad7768_dec_rate_values[shift];\ndrivers/iio/adc/ad7768-1.c:1062:\t\t*length = ARRAY_SIZE(ad7768_dec_rate_values) - shift;\ndrivers/iio/adc/ad7768-1.c-1063-\t\t*type = IIO_VAL_INT;\n--\ndrivers/iio/adc/ad7768-1.c-1079-\ndrivers/iio/adc/ad7768-1.c:1080:static int ad7768_write_raw_get_fmt(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1081-\t\t\t\t struct iio_chan_spec const *chan, long mask)\n--\ndrivers/iio/adc/ad7768-1.c-1090-\ndrivers/iio/adc/ad7768-1.c:1091:static int ad7768_write_raw(struct iio_dev *indio_dev,\ndrivers/iio/adc/ad7768-1.c-1092-\t\t\t struct iio_chan_spec const *chan,\n--\ndrivers/iio/adc/ad7768-1.c-1094-{\ndrivers/iio/adc/ad7768-1.c:1095:\tstruct ad7768_state *st = iio_priv(indio_dev);\ndrivers/iio/adc/ad7768-1.c-1096-\tconst struct iio_scan_type *scan_type;\n--\ndrivers/iio/adc/ad7768-1.c-1107-\ndrivers/iio/adc/ad7768-1.c:1108:\t\tret = ad7768_set_freq(st, val);\ndrivers/iio/adc/ad7768-1.c-1109-\t\tiio_device_release_direct(indio_dev);\n--\ndrivers/iio/adc/ad7768-1.c-1114-\ndrivers/iio/adc/ad7768-1.c:1115:\t\tret = ad7768_update_dec_rate(indio_dev, val);\ndrivers/iio/adc/ad7768-1.c-1116-\t\tiio_device_release_direct(indio_dev);\n--\ndrivers/iio/adc/ad7768-1.c-1124-\t\tif (scan_type-\u003esign == 's')\ndrivers/iio/adc/ad7768-1.c:1125:\t\t\tgain_mode = ad7768_calc_pga_gain(st, val, val2,\ndrivers/iio/adc/ad7768-1.c-1126-\t\t\t\t\t\t\t scan_type-\u003erealbits - 1);\ndrivers/iio/adc/ad7768-1.c-1127-\t\telse\ndrivers/iio/adc/ad7768-1.c:1128:\t\t\tgain_mode = ad7768_calc_pga_gain(st, val, val2,\ndrivers/iio/adc/ad7768-1.c-1129-\t\t\t\t\t\t\t scan_type-\u003erealbits);\ndrivers/iio/adc/ad7768-1.c-1130-\ndrivers/iio/adc/ad7768-1.c:1131:\t\treturn ad7768_set_pga_gain(st, gain_mode);\ndrivers/iio/adc/ad7768-1.c-1132-\t}\n--\ndrivers/iio/adc/ad7768-1.c-1137-\n\n"
} |
| 23/2 | 2026/09/18 07:46 | llm | patch-evaluator |
1mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 46242 output: 33 thoughts: 924 Thoughts: **Analyzing the Reachability of the ad7768-1 SPI ADC Driver for Fuzzing** Okay, so I'm looking at `ad7768-1.c`, an SPI ADC driver. The question is, can we actually get at this thing with syzkaller? First, I need to check syzkaller's syscall descriptions and how it handles SPI devices. Oh, right, the note about using the `read-syz-spec` and `syz-grepper` tools instead of `grepper` for syzkaller-specific stuff – I need to remember that. Damn, I don't see those tools listed in the available tools. My next line of thought: Are any SPI drivers currently fuzzed, or are SPI drivers inherently unreachable hardware in these environments? My gut tells me there's a reason nobody's gone after this, and I need to figure out why. Can an SPI device with `module_spi_driver`, like `ad7768`, even probe in QEMU or GCE? We are talking about standard virtual environments here. Does a virtual SPI bus exist in either QEMU or GCE? And does it have an ad7768 ADC attached? Given my experience with QEMU, I highly doubt it. Standard QEMU, especially x86_64, doesn't emulate the AD7768 chip or an SPI master to connect to it. Nor does syzkaller provide a virtual SPI bus like it does for USB, virtio, etc. I need to circle back and re-evaluate what virtual buses syzkaller *does* have, based on section 3, they mention virtio, USB gadget, loopback, netlink, binder, sockets. So SPI is not one of them. Section 2 mentions "Structurally unreachable hardware" as being vendor specific or needing physical components. Could SPI devices be instantiated via an alternate mechanism, like ACPI or Device Tree? In x86_64 QEMU/GCE, ACPI is fixed. It's set by QEMU, BIOS, seabios, or edk2. It *won't* include an `adi,ad7768-1` device. With Device Tree, it's the same story. QEMU uses ACPI on amd64, not DT, unless we are specifically testing OF overlays, and that doesn't apply here. Even if DT *was* enabled, there's no DT overlay sysfs mechanism without specific configs or out-of-tree patches. This rules out ACPI and Device Tree. Does ACPI even *have* an SPI bus on QEMU? No. Standard QEMU x86 (amd64) machines (pc or q35) do *not* have an SPI host controller with slave devices, and certainly not an AD7768-1. Could USB be the bridge? I have to consider all possibilities. Earlier, I grepped for `spi_new_device` in `drivers/spi`. I remember seeing `drivers/spi/spi-ch341.c` which creates a `spidev` device, not an `ad7768-1`. This is not the right fit. Are there any other USB-to-SPI bridges in the kernel? Time to grep for some more clues, `spi_register_controller` or `spi_alloc_host` or `spi_alloc_master`. I will have to figure out a better query later, but I don't see anything obvious. |
| 24/2 | 2026/09/18 07:47 | tool | grepper |
0mArgs:{
"Expression": "spi_alloc_host|spi_alloc_master",
"PathPrefix": "drivers/"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 868 lines.\nUse more precise expression if possible.\n\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c=173=int netup_spi_init(struct netup_unidvb_dev *ndev)\n--\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c-177-\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c:178:\tctlr = devm_spi_alloc_host(\u0026ndev-\u003epci_dev-\u003edev,\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c-179-\t\t\t\t sizeof(struct netup_spi));\n--\ndrivers/media/usb/msi2500/msi2500.c=1160=static int msi2500_probe(struct usb_interface *intf,\n--\ndrivers/media/usb/msi2500/msi2500.c-1221-\t/* SPI host adapter */\ndrivers/media/usb/msi2500/msi2500.c:1222:\tctlr = spi_alloc_host(dev-\u003edev, 0);\ndrivers/media/usb/msi2500/msi2500.c-1223-\tif (ctlr == NULL) {\n--\ndrivers/spi/atmel-quadspi.c=1348=static int atmel_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/atmel-quadspi.c-1354-\ndrivers/spi/atmel-quadspi.c:1355:\tctrl = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*aq));\ndrivers/spi/atmel-quadspi.c-1356-\tif (!ctrl)\n--\ndrivers/spi/spi-airoha-snfi.c=1060=static int airoha_snand_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-airoha-snfi.c-1069-\ndrivers/spi/spi-airoha-snfi.c:1070:\tctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));\ndrivers/spi/spi-airoha-snfi.c-1071-\tif (!ctrl)\n--\ndrivers/spi/spi-altera-dfl.c=124=static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)\n--\ndrivers/spi/spi-altera-dfl.c-132-\ndrivers/spi/spi-altera-dfl.c:133:\thost = devm_spi_alloc_host(dev, sizeof(struct altera_spi));\ndrivers/spi/spi-altera-dfl.c-134-\tif (!host)\n--\ndrivers/spi/spi-altera-platform.c=35=static int altera_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-altera-platform.c-44-\ndrivers/spi/spi-altera-platform.c:45:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct altera_spi));\ndrivers/spi/spi-altera-platform.c-46-\tif (!host)\n--\ndrivers/spi/spi-amd-pci.c=30=static int amd_spi_pci_probe(struct pci_dev *pdev,\n--\ndrivers/spi/spi-amd-pci.c-38-\t/* Allocate storage for host and driver private data */\ndrivers/spi/spi-amd-pci.c:39:\thost = devm_spi_alloc_host(dev, sizeof(struct amd_spi));\ndrivers/spi/spi-amd-pci.c-40-\tif (!host)\n--\ndrivers/spi/spi-amd.c=851=static int amd_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amd.c-857-\t/* Allocate storage for host and driver private data */\ndrivers/spi/spi-amd.c:858:\thost = devm_spi_alloc_host(dev, sizeof(struct amd_spi));\ndrivers/spi/spi-amd.c-859-\tif (!host)\n--\ndrivers/spi/spi-amlogic-spifc-a1.c=326=static int amlogic_spifc_a1_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spifc-a1.c-331-\ndrivers/spi/spi-amlogic-spifc-a1.c:332:\tctrl = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spifc));\ndrivers/spi/spi-amlogic-spifc-a1.c-333-\tif (!ctrl)\n--\ndrivers/spi/spi-amlogic-spifc-a4.c=1093=static int aml_sfc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spifc-a4.c-1109-\ndrivers/spi/spi-amlogic-spifc-a4.c:1110:\tctrl = devm_spi_alloc_host(dev, sizeof(*sfc));\ndrivers/spi/spi-amlogic-spifc-a4.c-1111-\tif (!ctrl)\n--\ndrivers/spi/spi-amlogic-spisg.c=712=static int aml_spisg_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spisg.c-729-\telse\ndrivers/spi/spi-amlogic-spisg.c:730:\t\tctlr = devm_spi_alloc_host(dev, sizeof(*spisg));\ndrivers/spi/spi-amlogic-spisg.c-731-\tif (!ctlr)\n--\ndrivers/spi/spi-apple.c=457=static int apple_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-apple.c-462-\ndrivers/spi/spi-apple.c:463:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct apple_spi));\ndrivers/spi/spi-apple.c-464-\tif (!ctlr)\n--\ndrivers/spi/spi-ar934x.c=165=static int ar934x_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ar934x.c-181-\ndrivers/spi/spi-ar934x.c:182:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*sp));\ndrivers/spi/spi-ar934x.c-183-\tif (!ctlr) {\n--\ndrivers/spi/spi-armada-3700.c=813=static int a3700_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-armada-3700.c-820-\ndrivers/spi/spi-armada-3700.c:821:\thost = devm_spi_alloc_host(dev, sizeof(*spi));\ndrivers/spi/spi-armada-3700.c-822-\tif (!host)\n--\ndrivers/spi/spi-aspeed-smc.c=957=static int aspeed_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-aspeed-smc.c-969-\ndrivers/spi/spi-aspeed-smc.c:970:\tctlr = devm_spi_alloc_host(dev, sizeof(*aspi));\ndrivers/spi/spi-aspeed-smc.c-971-\tif (!ctlr)\n--\ndrivers/spi/spi-at91-usart.c=476=static int at91_usart_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-at91-usart.c-497-\ndrivers/spi/spi-at91-usart.c:498:\tcontroller = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*aus));\ndrivers/spi/spi-at91-usart.c-499-\tif (!controller)\n--\ndrivers/spi/spi-atcspi200.c=546=static int atcspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-atcspi200.c-552-\ndrivers/spi/spi-atcspi200.c:553:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi));\ndrivers/spi/spi-atcspi200.c-554-\tif (!host)\n--\ndrivers/spi/spi-ath79.c=169=static int ath79_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ath79.c-175-\ndrivers/spi/spi-ath79.c:176:\thost = spi_alloc_host(\u0026pdev-\u003edev, sizeof(*sp));\ndrivers/spi/spi-ath79.c-177-\tif (host == NULL) {\n--\ndrivers/spi/spi-atmel.c=1550=static int atmel_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-atmel.c-1570-\t/* setup spi core then atmel-specific driver state */\ndrivers/spi/spi-atmel.c:1571:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*as));\ndrivers/spi/spi-atmel.c-1572-\tif (!host)\n--\ndrivers/spi/spi-au1550.c=714=static int au1550_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-au1550.c-720-\ndrivers/spi/spi-au1550.c:721:\thost = spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct au1550_spi));\ndrivers/spi/spi-au1550.c-722-\tif (host == NULL) {\n--\ndrivers/spi/spi-axi-spi-engine.c=1104=static int spi_engine_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-axi-spi-engine.c-1114-\ndrivers/spi/spi-axi-spi-engine.c:1115:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi_engine));\ndrivers/spi/spi-axi-spi-engine.c-1116-\tif (!host)\n--\ndrivers/spi/spi-axiado.c=752=static int ax_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-axiado.c-758-\ndrivers/spi/spi-axiado.c:759:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*xspi));\ndrivers/spi/spi-axiado.c-760-\tif (!ctlr)\n--\ndrivers/spi/spi-bcm-qspi.c=1482=int bcm_qspi_probe(struct platform_device *pdev,\n--\ndrivers/spi/spi-bcm-qspi.c-1506-\ndrivers/spi/spi-bcm-qspi.c:1507:\thost = devm_spi_alloc_host(dev, sizeof(struct bcm_qspi));\ndrivers/spi/spi-bcm-qspi.c-1508-\tif (!host) {\n--\ndrivers/spi/spi-bcm2835.c=1349=static int bcm2835_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm2835.c-1354-\ndrivers/spi/spi-bcm2835.c:1355:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcm2835.c-1356-\tif (!ctlr)\n--\ndrivers/spi/spi-bcm2835aux.c=474=static int bcm2835aux_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm2835aux.c-480-\ndrivers/spi/spi-bcm2835aux.c:481:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcm2835aux.c-482-\tif (!host)\n--\ndrivers/spi/spi-bcm63xx-hsspi.c=742=static int bcm63xx_hsspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm63xx-hsspi.c-785-\ndrivers/spi/spi-bcm63xx-hsspi.c:786:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcm63xx-hsspi.c-787-\tif (!host)\n--\ndrivers/spi/spi-bcm63xx.c=491=static int bcm63xx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm63xx.c-542-\ndrivers/spi/spi-bcm63xx.c:543:\thost = devm_spi_alloc_host(dev, sizeof(*bs));\ndrivers/spi/spi-bcm63xx.c-544-\tif (!host)\n--\ndrivers/spi/spi-bcmbca-hsspi.c=432=static int bcmbca_hsspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcmbca-hsspi.c-474-\ndrivers/spi/spi-bcmbca-hsspi.c:475:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcmbca-hsspi.c-476-\tif (!host)\n--\ndrivers/spi/spi-butterfly.c=176=static void butterfly_attach(struct parport *p)\n--\ndrivers/spi/spi-butterfly.c-191-\ndrivers/spi/spi-butterfly.c:192:\thost = spi_alloc_host(dev, sizeof(*pp));\ndrivers/spi/spi-butterfly.c-193-\tif (!host) {\n--\ndrivers/spi/spi-cadence-quadspi.c=1781=static int cqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence-quadspi.c-1790-\ndrivers/spi/spi-cadence-quadspi.c:1791:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*cqspi));\ndrivers/spi/spi-cadence-quadspi.c-1792-\tif (!host)\n--\ndrivers/spi/spi-cadence-xspi.c=1174=static int cdns_xspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence-xspi.c-1181-\ndrivers/spi/spi-cadence-xspi.c:1182:\thost = devm_spi_alloc_host(dev, sizeof(*cdns_xspi));\ndrivers/spi/spi-cadence-xspi.c-1183-\tif (!host)\n--\ndrivers/spi/spi-cadence.c=636=static int cdns_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence.c-647-\telse\ndrivers/spi/spi-cadence.c:648:\t\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*xspi));\ndrivers/spi/spi-cadence.c-649-\n--\ndrivers/spi/spi-cavium-octeon.c=19=static int octeon_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cavium-octeon.c-25-\ndrivers/spi/spi-cavium-octeon.c:26:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct octeon_spi));\ndrivers/spi/spi-cavium-octeon.c-27-\tif (!host)\n--\ndrivers/spi/spi-cavium-thunderx.c=19=static int thunderx_spi_probe(struct pci_dev *pdev,\n--\ndrivers/spi/spi-cavium-thunderx.c-26-\ndrivers/spi/spi-cavium-thunderx.c:27:\thost = devm_spi_alloc_host(dev, sizeof(struct octeon_spi));\ndrivers/spi/spi-cavium-thunderx.c-28-\tif (!host)\n--\ndrivers/spi/spi-ch341.c=141=static int ch341_probe(struct usb_interface *intf,\n--\ndrivers/spi/spi-ch341.c-154-\ndrivers/spi/spi-ch341.c:155:\tctrl = devm_spi_alloc_host(\u0026intf-\u003edev, sizeof(struct ch341_spi_dev));\ndrivers/spi/spi-ch341.c-156-\tif (!ctrl)\n--\ndrivers/spi/spi-clps711x.c=91=static int spi_clps711x_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-clps711x.c-101-\ndrivers/spi/spi-clps711x.c:102:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*hw));\ndrivers/spi/spi-clps711x.c-103-\tif (!host)\n--\ndrivers/spi/spi-coldfire-qspi.c=338=static int mcfqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-coldfire-qspi.c-355-\ndrivers/spi/spi-coldfire-qspi.c:356:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*mcfqspi));\ndrivers/spi/spi-coldfire-qspi.c-357-\tif (host == NULL)\n--\ndrivers/spi/spi-cs42l43.c=313=static int cs42l43_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cs42l43.c-326-\ndrivers/spi/spi-cs42l43.c:327:\tpriv-\u003ectlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*priv-\u003ectlr));\ndrivers/spi/spi-cs42l43.c-328-\tif (!priv-\u003ectlr)\n--\ndrivers/spi/spi-davinci.c=922=static int davinci_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-davinci.c-930-\ndrivers/spi/spi-davinci.c:931:\thost = spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct davinci_spi));\ndrivers/spi/spi-davinci.c-932-\tif (host == NULL) {\n--\ndrivers/spi/spi-dln2.c=680=static int dln2_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-dln2.c-686-\ndrivers/spi/spi-dln2.c:687:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*dln2));\ndrivers/spi/spi-dln2.c-688-\tif (!host)\n--\ndrivers/spi/spi-dw-core.c=923=int dw_spi_add_controller(struct device *dev, struct dw_spi *dws)\n--\ndrivers/spi/spi-dw-core.c-935-\telse\ndrivers/spi/spi-dw-core.c:936:\t\tctlr = spi_alloc_host(dev, 0);\ndrivers/spi/spi-dw-core.c-937-\n--\ndrivers/spi/spi-ep93xx.c=623=static int ep93xx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ep93xx.c-634-\ndrivers/spi/spi-ep93xx.c:635:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*espi));\ndrivers/spi/spi-ep93xx.c-636-\tif (!host)\n--\ndrivers/spi/spi-falcon.c=391=static int falcon_sflash_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-falcon.c-395-\ndrivers/spi/spi-falcon.c:396:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*priv));\ndrivers/spi/spi-falcon.c-397-\tif (!host)\n--\ndrivers/spi/spi-fsi.c=531=static int fsi_spi_probe(struct fsi_device *fsi)\n--\ndrivers/spi/spi-fsi.c-556-\ndrivers/spi/spi-fsi.c:557:\t\tctlr = devm_spi_alloc_host(dev, sizeof(*ctx));\ndrivers/spi/spi-fsi.c-558-\t\tif (!ctlr)\n--\ndrivers/spi/spi-fsl-dspi.c=1528=static int dspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-dspi.c-1545-\telse\ndrivers/spi/spi-fsl-dspi.c:1546:\t\tctlr = spi_alloc_host(\u0026pdev-\u003edev, 0);\ndrivers/spi/spi-fsl-dspi.c-1547-\tif (!ctlr)\n--\ndrivers/spi/spi-fsl-espi.c=663=static int fsl_espi_probe(struct device *dev, struct resource *mem,\n--\ndrivers/spi/spi-fsl-espi.c-669-\ndrivers/spi/spi-fsl-espi.c:670:\thost = devm_spi_alloc_host(dev, sizeof(struct fsl_espi));\ndrivers/spi/spi-fsl-espi.c-671-\tif (!host)\n--\ndrivers/spi/spi-fsl-lpspi.c=892=static int fsl_lpspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-lpspi.c-911-\telse\ndrivers/spi/spi-fsl-lpspi.c:912:\t\tcontroller = devm_spi_alloc_host(\u0026pdev-\u003edev,\ndrivers/spi/spi-fsl-lpspi.c-913-\t\t\t\t\t\t sizeof(struct fsl_lpspi_data));\n--\ndrivers/spi/spi-fsl-qspi.c=894=static int fsl_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-qspi.c-902-\ndrivers/spi/spi-fsl-qspi.c:903:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*q));\ndrivers/spi/spi-fsl-qspi.c-904-\tif (!ctlr)\n--\ndrivers/spi/spi-fsl-spi.c=528=static struct spi_controller *fsl_spi_probe(struct device *dev,\n--\ndrivers/spi/spi-fsl-spi.c-537-\ndrivers/spi/spi-fsl-spi.c:538:\thost = devm_spi_alloc_host(dev, sizeof(struct mpc8xxx_spi));\ndrivers/spi/spi-fsl-spi.c-539-\tif (host == NULL) {\n--\ndrivers/spi/spi-geni-qcom.c=1042=static int spi_geni_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-geni-qcom.c-1069-\telse\ndrivers/spi/spi-geni-qcom.c:1070:\t\tspi = devm_spi_alloc_host(dev, sizeof(*mas));\ndrivers/spi/spi-geni-qcom.c-1071-\n--\ndrivers/spi/spi-gpio.c=340=static int spi_gpio_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-gpio.c-348-\ndrivers/spi/spi-gpio.c:349:\thost = devm_spi_alloc_host(dev, sizeof(*spi_gpio));\ndrivers/spi/spi-gpio.c-350-\tif (!host)\n--\ndrivers/spi/spi-gxp.c=250=static int gxp_spifi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-gxp.c-259-\ndrivers/spi/spi-gxp.c:260:\tctlr = devm_spi_alloc_host(dev, sizeof(*spifi));\ndrivers/spi/spi-gxp.c-261-\tif (!ctlr)\n--\ndrivers/spi/spi-hisi-kunpeng.c=461=static int hisi_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-hisi-kunpeng.c-472-\ndrivers/spi/spi-hisi-kunpeng.c:473:\thost = devm_spi_alloc_host(dev, sizeof(*hs));\ndrivers/spi/spi-hisi-kunpeng.c-474-\tif (!host)\n--\ndrivers/spi/spi-hisi-sfc-v3xx.c=431=static int hisi_sfc_v3xx_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-hisi-sfc-v3xx.c-438-\ndrivers/spi/spi-hisi-sfc-v3xx.c:439:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/spi/spi-hisi-sfc-v3xx.c-440-\tif (!ctlr)\n--\ndrivers/spi/spi-img-spfi.c=525=static int img_spfi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-img-spfi.c-532-\ndrivers/spi/spi-img-spfi.c:533:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spfi));\ndrivers/spi/spi-img-spfi.c-534-\tif (!host)\n--\ndrivers/spi/spi-imx.c=2218=static int spi_imx_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-imx.c-2234-\telse\ndrivers/spi/spi-imx.c:2235:\t\tcontroller = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi_imx));\ndrivers/spi/spi-imx.c-2236-\tif (!controller)\n--\ndrivers/spi/spi-ingenic.c=383=static int spi_ingenic_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ingenic.c-397-\ndrivers/spi/spi-ingenic.c:398:\tctlr = devm_spi_alloc_host(dev, sizeof(*priv));\ndrivers/spi/spi-ingenic.c-399-\tif (!ctlr) {\n--\ndrivers/spi/spi-intel.c=1489=int intel_spi_probe(struct device *dev, void __iomem *base,\n--\ndrivers/spi/spi-intel.c-1495-\ndrivers/spi/spi-intel.c:1496:\thost = devm_spi_alloc_host(dev, sizeof(*ispi));\ndrivers/spi/spi-intel.c-1497-\tif (!host)\n--\ndrivers/spi/spi-jcore.c=141=static int jcore_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-jcore.c-149-\ndrivers/spi/spi-jcore.c:150:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct jcore_spi));\ndrivers/spi/spi-jcore.c-151-\tif (!host)\n--\ndrivers/spi/spi-kspi2.c=338=static int kspi2_probe(struct auxiliary_device *auxdev,\n--\ndrivers/spi/spi-kspi2.c-346-\ndrivers/spi/spi-kspi2.c:347:\thost = devm_spi_alloc_host(dev, sizeof(struct kspi2));\ndrivers/spi/spi-kspi2.c-348-\tif (!host)\n--\ndrivers/spi/spi-lantiq-ssc.c=904=static int lantiq_ssc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-lantiq-ssc.c-915-\ndrivers/spi/spi-lantiq-ssc.c:916:\thost = devm_spi_alloc_host(dev, sizeof(struct lantiq_ssc_spi));\ndrivers/spi/spi-lantiq-ssc.c-917-\tif (!host)\n--\ndrivers/spi/spi-ljca.c=218=static int ljca_spi_probe(struct auxiliary_device *auxdev,\n--\ndrivers/spi/spi-ljca.c-225-\ndrivers/spi/spi-ljca.c:226:\tcontroller = devm_spi_alloc_host(\u0026auxdev-\u003edev, sizeof(*ljca_spi));\ndrivers/spi/spi-ljca.c-227-\tif (!controller)\n--\ndrivers/spi/spi-lm70llp.c=188=static void spi_lm70llp_attach(struct parport *p)\n--\ndrivers/spi/spi-lm70llp.c-204-\ndrivers/spi/spi-lm70llp.c:205:\thost = spi_alloc_host(p-\u003ephysport-\u003edev, sizeof(*pp));\ndrivers/spi/spi-lm70llp.c-206-\tif (!host) {\n--\ndrivers/spi/spi-loongson-core.c=196=int loongson_spi_init_controller(struct device *dev, void __iomem *regs)\n--\ndrivers/spi/spi-loongson-core.c-201-\ndrivers/spi/spi-loongson-core.c:202:\tcontroller = devm_spi_alloc_host(dev, sizeof(struct loongson_spi));\ndrivers/spi/spi-loongson-core.c-203-\tif (controller == NULL)\n--\ndrivers/spi/spi-lp8841-rtc.c=182=spi_lp8841_rtc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-lp8841-rtc.c-187-\ndrivers/spi/spi-lp8841-rtc.c:188:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*data));\ndrivers/spi/spi-lp8841-rtc.c-189-\tif (!host)\n--\ndrivers/spi/spi-meson-spicc.c=978=static int meson_spicc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-meson-spicc.c-983-\ndrivers/spi/spi-meson-spicc.c:984:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spicc));\ndrivers/spi/spi-meson-spicc.c-985-\tif (!host) {\n--\ndrivers/spi/spi-meson-spifc.c=285=static int meson_spifc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-meson-spifc.c-292-\ndrivers/spi/spi-meson-spifc.c:293:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct meson_spifc));\ndrivers/spi/spi-meson-spifc.c-294-\tif (!host)\n--\ndrivers/spi/spi-microchip-core-qspi.c=719=static int mchp_coreqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-microchip-core-qspi.c-727-\ndrivers/spi/spi-microchip-core-qspi.c:728:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*qspi));\ndrivers/spi/spi-microchip-core-qspi.c-729-\tif (!ctlr)\n--\ndrivers/spi/spi-microchip-core-spi.c=287=static int mchp_corespi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-microchip-core-spi.c-297-\ndrivers/spi/spi-microchip-core-spi.c:298:\thost = devm_spi_alloc_host(dev, sizeof(*spi));\ndrivers/spi/spi-microchip-core-spi.c-299-\tif (!host)\n--\ndrivers/spi/spi-mpc512x-psc.c=458=static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpc512x-psc.c-466-\ndrivers/spi/spi-mpc512x-psc.c:467:\thost = devm_spi_alloc_host(dev, sizeof(*mps));\ndrivers/spi/spi-mpc512x-psc.c-468-\tif (host == NULL)\n--\ndrivers/spi/spi-mpc52xx-psc.c=294=static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpc52xx-psc.c-301-\ndrivers/spi/spi-mpc52xx-psc.c:302:\thost = devm_spi_alloc_host(dev, sizeof(*mps));\ndrivers/spi/spi-mpc52xx-psc.c-303-\tif (host == NULL)\n--\ndrivers/spi/spi-mpc52xx.c=387=static int mpc52xx_spi_probe(struct platform_device *op)\n--\ndrivers/spi/spi-mpc52xx.c-423-\tdev_dbg(\u0026op-\u003edev, \"allocating spi_controller struct\\n\");\ndrivers/spi/spi-mpc52xx.c:424:\thost = spi_alloc_host(\u0026op-\u003edev, sizeof(*ms));\ndrivers/spi/spi-mpc52xx.c-425-\tif (!host) {\n--\ndrivers/spi/spi-mpfs.c=527=static int mpfs_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpfs.c-534-\ndrivers/spi/spi-mpfs.c:535:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi));\ndrivers/spi/spi-mpfs.c-536-\tif (!host)\n--\ndrivers/spi/spi-mt65xx.c=1175=static int mtk_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mt65xx.c-1181-\ndrivers/spi/spi-mt65xx.c:1182:\thost = devm_spi_alloc_host(dev, sizeof(*mdata));\ndrivers/spi/spi-mt65xx.c-1183-\tif (!host)\n--\ndrivers/spi/spi-mt7621.c=316=static int mt7621_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mt7621.c-337-\ndrivers/spi/spi-mt7621.c:338:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*rs));\ndrivers/spi/spi-mt7621.c-339-\tif (!host) {\n--\ndrivers/spi/spi-mtk-nor.c=810=static int mtk_nor_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mtk-nor.c-846-\ndrivers/spi/spi-mtk-nor.c:847:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*sp));\ndrivers/spi/spi-mtk-nor.c-848-\tif (!ctlr) {\n--\ndrivers/spi/spi-mtk-snfi.c=1338=static int mtk_snand_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mtk-snfi.c-1351-\ndrivers/spi/spi-mtk-snfi.c:1352:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*ms));\ndrivers/spi/spi-mtk-snfi.c-1353-\tif (!ctlr)\n--\ndrivers/spi/spi-mux.c=126=static int spi_mux_probe(struct spi_device *spi)\n--\ndrivers/spi/spi-mux.c-130-\ndrivers/spi/spi-mux.c:131:\tctlr = devm_spi_alloc_host(\u0026spi-\u003edev, sizeof(*priv));\ndrivers/spi/spi-mux.c-132-\tif (!ctlr)\n--\ndrivers/spi/spi-mxic.c=755=static int mxic_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mxic.c-761-\ndrivers/spi/spi-mxic.c:762:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct mxic_spi));\ndrivers/spi/spi-mxic.c-763-\tif (!host)\n--\ndrivers/spi/spi-mxs.c=528=static int mxs_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mxs.c-565-\ndrivers/spi/spi-mxs.c:566:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi));\ndrivers/spi/spi-mxs.c-567-\tif (!host)\n--\ndrivers/spi/spi-npcm-fiu.c=689=static int npcm_fiu_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-npcm-fiu.c-697-\ndrivers/spi/spi-npcm-fiu.c:698:\tctrl = devm_spi_alloc_host(dev, sizeof(*fiu));\ndrivers/spi/spi-npcm-fiu.c-699-\tif (!ctrl)\n--\ndrivers/spi/spi-npcm-pspi.c=340=static int npcm_pspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-npcm-pspi.c-347-\ndrivers/spi/spi-npcm-pspi.c:348:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*priv));\ndrivers/spi/spi-npcm-pspi.c-349-\tif (!host)\n--\ndrivers/spi/spi-nxp-fspi.c=1286=static int nxp_fspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-nxp-fspi.c-1295-\ndrivers/spi/spi-nxp-fspi.c:1296:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*f));\ndrivers/spi/spi-nxp-fspi.c-1297-\tif (!ctlr)\n--\ndrivers/spi/spi-nxp-xspi.c=1208=static int nxp_xspi_probe(struct platform_device *pdev)\n--\n\n"
} |
| 25/2 | 2026/09/18 07:47 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 58457 output: 38 thoughts: 95 Thoughts: **My SPI Device Instantiation Journey** Okay, so I'm thinking about how SPI child devices get registered in Linux, and the process isn't as straightforward as I'd like. It's not like with I2C, where we have that handy `new_device` sysfs interface for userspace to instantiate arbitrary devices. Nope, with SPI, it's typically board-info, ACPI, or DT devices. Just to be absolutely certain I'm not missing something, I'm going to quickly double-check the code, specifically `drivers/spi/spi.c`. Gotta be thorough, you know? Sometimes the obvious thing isn't so obvious, and I want to be 100% accurate. Let's see what `spi.c` has to say... |
| 26/2 | 2026/09/18 07:47 | tool | grepper |
0mError:no matches Args: {
"Expression": "DEVICE_ATTR.*new_device|DRIVER_ATTR.*new_device",
"PathPrefix": "drivers/spi"
}Results: {
"error": "no matches"
} |
| 27/2 | 2026/09/18 07:47 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 58774 output: 30 thoughts: 20 Thoughts: Here's my thought process, as requested: **Checking for New SPI Device Implementation** Okay, so I need to see if there's a fresh driver in the SPI subsystem. I want to quickly determine if a new device has been recently added. Essentially, I need to know: has someone submitted code that includes a new `new_device` definition within the `drivers/spi` directory? Time to dig in and see. |
| 28/2 | 2026/09/18 07:47 | tool | grepper |
0mArgs:{
"Expression": "new_device",
"PathPrefix": "drivers/spi/spi.c"
}Results: {
"Output": "drivers/spi/spi.c=788=EXPORT_SYMBOL_GPL(spi_add_device);\n--\ndrivers/spi/spi.c-790-/**\ndrivers/spi/spi.c:791: * spi_new_device - instantiate one new SPI device\ndrivers/spi/spi.c-792- * @ctlr: Controller to which device is connected\n--\ndrivers/spi/spi.c-803- */\ndrivers/spi/spi.c:804:struct spi_device *spi_new_device(struct spi_controller *ctlr,\ndrivers/spi/spi.c-805-\t\t\t\t struct spi_board_info *chip)\n--\ndrivers/spi/spi.c-859-}\ndrivers/spi/spi.c:860:EXPORT_SYMBOL_GPL(spi_new_device);\ndrivers/spi/spi.c-861-\n--\ndrivers/spi/spi.c=890=static void spi_match_controller_to_boardinfo(struct spi_controller *ctlr,\n--\ndrivers/spi/spi.c-897-\ndrivers/spi/spi.c:898:\tdev = spi_new_device(ctlr, bi);\ndrivers/spi/spi.c-899-\tif (!dev)\n"
} |
| 29/2 | 2026/09/18 07:47 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59240 output: 25 thoughts: 42 Thoughts: **My Immediate Thoughts on SPI Device Instantiation** Yes, that's absolutely right! I can't think of any straightforward way within userspace to just *create* an arbitrary SPI device. That's a fundamental limitation of the standard interface. But, a thought just struck me: what about *configfs*? Could that be leveraged here, given its role in dynamic device configuration? It's a long shot, but worth exploring. The ability to create virtual filesystems for configuration is what makes me think it might be possible to instantiate the SPI device. I need to get into the driver code, and see if there's any configfs support lurking within the `drivers/spi` directory. This seems like the logical next step to figuring out a workaround. |
| 30/2 | 2026/09/18 07:47 | tool | grepper |
0mError:no matches Args: {
"Expression": "configfs",
"PathPrefix": "drivers/spi"
}Results: {
"error": "no matches"
} |
| 31/2 | 2026/09/18 07:47 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59480 output: 18 thoughts: 52 Thoughts: **Investigating SPI Driver Configuration** Okay, so I'm diving into this SPI driver situation and the first thing that jumps out is the absence of `configfs` directly within the `drivers/spi` directory. That's a bit unexpected, but not necessarily a showstopper. My initial assumption was wrong. Then, a thought sparks – what about using Device Tree overlays from userspace? Specifically, the `configfs` interface under `/sys/kernel/config/device-tree/overlays`? That's the likely avenue, if I remember correctly, so let's make sure that's how it is. It's time to confirm whether `CONFIG_OF_CONFIGFS` is enabled. That'll be the key to understanding if this overlay-based approach is even an option. |
| 32/2 | 2026/09/18 07:47 | tool | grepper |
0mError:no matches Args: {
"Expression": "OF_CONFIGFS"
}Results: {
"error": "no matches"
} |
| 33/2 | 2026/09/18 07:47 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59733 output: 19 thoughts: 13 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Kernel Configuration Consideration** Okay, hold on a second. We were deep in the weeds with this configuration issue, and I just realized... what about `CONFIG_OF_OVERLAY`? We're dealing with device tree overlays here, and I haven't explicitly checked whether that's properly enabled and configured. Could be the root of the problem. We've got to make absolutely sure that the kernel is aware it *needs* to handle overlays before we waste any more time digging into the specifics of the DTSI files and the overlay application process. Before I go chasing ghosts in the device tree, I need to verify that fundamental support is in place. Otherwise, we're just talking past the compiler. |
| 34/2 | 2026/09/18 07:47 | tool | grepper |
0mArgs:{
"Expression": "config OF_OVERLAY"
}Results: {
"Output": "drivers/of/Kconfig=102=config OF_RESOLVE\n--\ndrivers/of/Kconfig-104-\ndrivers/of/Kconfig:105:config OF_OVERLAY\ndrivers/of/Kconfig-106-\tbool \"Device Tree overlays\"\n--\ndrivers/of/Kconfig-115-\ndrivers/of/Kconfig:116:config OF_OVERLAY_KUNIT_TEST\ndrivers/of/Kconfig-117-\ttristate \"Device Tree overlay KUnit tests\" if !KUNIT_ALL_TESTS\n"
} |
| 35/2 | 2026/09/18 07:47 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 60079 output: 45 thoughts: 551 Thoughts: **Analyzing the AD7768-1 Probe on amd64** Okay, so I'm looking at how the AD7768-1 probe works, specifically on an amd64 target. Since this is an x86/amd64 system, and running in a standard VM like QEMU or GCE, I know OpenFirmware (OF) isn't the primary mechanism here. ACPI is the standard, and `CONFIG_OF` is likely disabled or at least not providing the root Device Tree. My question is, can this AD7768-1 probe function without the hardware physically present? Let's dive into the `ad7768_probe` function to see. It looks like it begins by allocating an industrial I/O (IIO) device structure using `devm_iio_device_alloc`. Then, there's a check for `SPI_MOSI_IDLE_HIGH` mode. If set, it configures SPI mode via `spi_setup`. Crucially, it retrieves device-specific data with `spi_get_device_match_data`, and then initializes two regmaps: `st->regmap` and `st->regmap24`. Those are initialized via `devm_regmap_init_spi` with associated config structs. Next, it attempts to get the VREF voltage using `devm_regulator_get_enable_read_voltage`, and also retrieves the master clock with `devm_clk_get_enabled`. If these operations fail, it returns an error. Finally, it calls the `ad7768_setup` function. Now, I need to see what's happening within `ad7768_setup` to understand what’s really required to successfully initialize the chip. |
| 36/2 | 2026/09/18 07:48 | tool | read-file |
0mArgs:{
"File": "drivers/iio/adc/ad7768-1.c",
"FirstLine": 1240,
"LineCount": 40
}Results: {
"Contents": "1240:\t{\n1241:\t\tstruct ad7768_state *st = iio_priv(indio_dev);\n1242:\t\tint ret;\n1243:\t\n1244:\t\tst-\u003egpio_reset = devm_gpiod_get_optional(\u0026st-\u003espi-\u003edev, \"reset\",\n1245:\t\t\t\t\t\t\t GPIOD_OUT_HIGH);\n1246:\t\tif (IS_ERR(st-\u003egpio_reset))\n1247:\t\t\treturn PTR_ERR(st-\u003egpio_reset);\n1248:\t\n1249:\t\tif (st-\u003egpio_reset) {\n1250:\t\t\tfsleep(10);\n1251:\t\t\tgpiod_set_value_cansleep(st-\u003egpio_reset, 0);\n1252:\t\t\tfsleep(200);\n1253:\t\t} else {\n1254:\t\t\t/*\n1255:\t\t\t * Two writes to the SPI_RESET[1:0] bits are required to initiate\n1256:\t\t\t * a software reset. The bits must first be set to 11, and then\n1257:\t\t\t * to 10. When the sequence is detected, the reset occurs.\n1258:\t\t\t * See the datasheet, page 70.\n1259:\t\t\t */\n1260:\t\t\tret = regmap_write(st-\u003eregmap, AD7768_REG_SYNC_RESET, 0x3);\n1261:\t\t\tif (ret)\n1262:\t\t\t\treturn ret;\n1263:\t\n1264:\t\t\tret = regmap_write(st-\u003eregmap, AD7768_REG_SYNC_RESET, 0x2);\n1265:\t\t\tif (ret)\n1266:\t\t\t\treturn ret;\n1267:\t\t}\n1268:\t\n1269:\t\tret = ad7768_set_mode(st, AD7768_CONTINUOUS);\n1270:\t\tif (ret)\n1271:\t\t\treturn ret;\n1272:\t\n1273:\t\t/* For backwards compatibility, try the adi,sync-in-gpios property */\n1274:\t\tst-\u003egpio_sync_in = devm_gpiod_get_optional(\u0026st-\u003espi-\u003edev, \"adi,sync-in\",\n1275:\t\t\t\t\t\t\t GPIOD_OUT_LOW);\n1276:\t\tif (IS_ERR(st-\u003egpio_sync_in))\n1277:\t\t\treturn PTR_ERR(st-\u003egpio_sync_in);\n1278:\t\n1279:\t\t/*\n"
} |
| 37/2 | 2026/09/18 07:48 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 61732 output: 27 thoughts: 1257 Thoughts: **Analyzing Reachability of AD7768-1 Driver for Fuzzing** Okay, let's break this down. First, I see `devm_request_irq` being used with `spi->irq`. If `spi->irq` is invalid, the call will fail, which is expected. I then see `devm_iio_triggered_buffer_setup` being called. I need to understand this sequence, and the changes made by the commit. It looks like the commit has changed the order of `iio_trigger_get` and `devm_iio_triggered_buffer_setup`. Critically, if the setup fails *now*, `indio_dev->trig` won't be set, which is the correct behaviour. Now, the main concern: is this `ad7768-1.c` code reachable in a standard fuzzing environment? Let's review the definition of "structurally unreachable hardware". It mentions things like vendor-specific PCIe switches and GPU drivers that require specific hardware not emulated in standard QEMU. The key is *reachability*. Can we get this code to execute? The prompt states fuzzing only works if the code can execute in a standard virtualized environment (QEMU, GCE). I need to determine if an SPI device like AD7768-1 is considered "reachable". The text says reachable drivers are those accessible via virtual buses: virtio, USB gadget, netlink, etc. An SPI device, however, is a physical bus device (SPI bus). In a standard QEMU amd64 setup, is there an *emulated* AD7768-1 SPI device? No. Unlike USB devices, which *can* be emulated using Raw Gadget/Dummy HCD, SPI devices aren't emulated or attached directly from userspace. Even if a USB-to-SPI adapter exists (like CH341), it'd create a generic `spidev` device, not specifically `ad7768-1`. So, the next question is: can platform devices or I2C emulations be used? No. `ad7768-1` is an SPI driver, not a platform or I2C driver. I2C has `/sys/bus/i2c/devices/i2c-X/new_device`, but there is no such thing for SPI. And there is no SPI controller in a standard QEMU amd64 configuration with `ad7768-1` attached. The final question is: can we instantiate SPI devices through ACPI DSDT, driver binding, or mocks? I need to search the kernel for any support for mocking or testing SPI devices. I'll search the kernel source for any other method for probing an `spi_driver`. Is there an SPI test controller or mock controller? I'll grep for `spi_bus_type` in the drivers directory to see what I can find. If no standard way is found, this hardware is *unreachable*, and fuzzing is inappropriate. |
| 38/2 | 2026/09/18 07:48 | tool | grepper |
0mArgs:{
"Expression": "spi_bus_type",
"PathPrefix": "drivers/"
}Results: {
"Output": "drivers/net/ethernet/microchip/encx24j600.c=1114=static struct spi_driver encx24j600_spi_net_driver = {\n--\ndrivers/net/ethernet/microchip/encx24j600.c-1116-\t\t.name\t= DRV_NAME,\ndrivers/net/ethernet/microchip/encx24j600.c:1117:\t\t.bus\t= \u0026spi_bus_type,\ndrivers/net/ethernet/microchip/encx24j600.c-1118-\t},\n--\ndrivers/net/wan/slic_ds26522.c=234=static struct spi_driver slic_ds26522_driver = {\n--\ndrivers/net/wan/slic_ds26522.c-236-\t\t .name = \"ds26522\",\ndrivers/net/wan/slic_ds26522.c:237:\t\t .bus = \u0026spi_bus_type,\ndrivers/net/wan/slic_ds26522.c-238-\t\t .of_match_table = slic_ds26522_match,\n--\ndrivers/platform/x86/x86-android-tablets/lenovo.c=521=static int __init lenovo_yoga_tab2_830_1050_init_codec(void)\n--\ndrivers/platform/x86/x86-android-tablets/lenovo.c-526-\ndrivers/platform/x86/x86-android-tablets/lenovo.c:527:\tcodec_dev = bus_find_device_by_name(\u0026spi_bus_type, NULL,\ndrivers/platform/x86/x86-android-tablets/lenovo.c-528-\t\t\t\t\t LENOVO_YOGA_TAB2_830_1050_CODEC_NAME);\n--\ndrivers/spi/spi.c=443=static void spi_shutdown(struct device *dev)\n--\ndrivers/spi/spi.c-452-\ndrivers/spi/spi.c:453:const struct bus_type spi_bus_type = {\ndrivers/spi/spi.c-454-\t.name\t\t= \"spi\",\n--\ndrivers/spi/spi.c-461-};\ndrivers/spi/spi.c:462:EXPORT_SYMBOL_GPL(spi_bus_type);\ndrivers/spi/spi.c-463-\n--\ndrivers/spi/spi.c=472=int __spi_register_driver(struct module *owner, struct spi_driver *sdrv)\n--\ndrivers/spi/spi.c-474-\tsdrv-\u003edriver.owner = owner;\ndrivers/spi/spi.c:475:\tsdrv-\u003edriver.bus = \u0026spi_bus_type;\ndrivers/spi/spi.c-476-\n--\ndrivers/spi/spi.c=558=struct spi_device *spi_alloc_device(struct spi_controller *ctlr)\n--\ndrivers/spi/spi.c-579-\tspi-\u003edev.parent = \u0026ctlr-\u003edev;\ndrivers/spi/spi.c:580:\tspi-\u003edev.bus = \u0026spi_bus_type;\ndrivers/spi/spi.c-581-\tspi-\u003edev.release = spidev_release;\n--\ndrivers/spi/spi.c=674=static int __spi_add_device(struct spi_device *spi, struct spi_device *parent)\n--\ndrivers/spi/spi.c-723-\tcheck_info.parent = parent;\ndrivers/spi/spi.c:724:\tstatus = bus_for_each_dev(\u0026spi_bus_type, NULL, \u0026check_info, spi_dev_check);\ndrivers/spi/spi.c-725-\tif (status)\n--\ndrivers/spi/spi.c=4956=static struct spi_device *of_find_spi_device_by_node(struct device_node *node)\ndrivers/spi/spi.c-4957-{\ndrivers/spi/spi.c:4958:\tstruct device *dev = bus_find_device_by_of_node(\u0026spi_bus_type, node);\ndrivers/spi/spi.c-4959-\n--\ndrivers/spi/spi.c=5042=static struct spi_device *acpi_spi_find_device_by_adev(struct acpi_device *adev)\n--\ndrivers/spi/spi.c-5045-\ndrivers/spi/spi.c:5046:\tdev = bus_find_device_by_acpi_dev(\u0026spi_bus_type, adev);\ndrivers/spi/spi.c-5047-\treturn to_spi_device(dev);\n--\ndrivers/spi/spi.c=5089=static int __init spi_init(void)\n--\ndrivers/spi/spi.c-5098-\ndrivers/spi/spi.c:5099:\tstatus = bus_register(\u0026spi_bus_type);\ndrivers/spi/spi.c-5100-\tif (status \u003c 0)\n--\ndrivers/spi/spi.c-5122-err2:\ndrivers/spi/spi.c:5123:\tbus_unregister(\u0026spi_bus_type);\ndrivers/spi/spi.c-5124-err1:\n"
} |
| 39/2 | 2026/09/18 07:48 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 65051 output: 35 thoughts: 45 Thoughts: **Investigating the SPI Bus Driver** Okay, so I'm diving into this SPI bus issue. It looks like the `spi_bus_type` structure doesn't have a `new_device` attribute defined. That's a bit odd; I would have expected to see that there. Time to dig deeper. I'll need to confirm if that's accurate, and then understand how new devices are being registered on the bus. Let's start by checking the `drivers/spi/spi.c` file, specifically around lines 450 to 470. That should give me a solid clue about how the system handles the creation and attachment of new SPI devices. Hopefully, this section will shed some light on the device registration mechanism and what I'm missing here. |
| 40/2 | 2026/09/18 07:48 | tool | read-file |
0mArgs:{
"File": "drivers/spi/spi.c",
"FirstLine": 445,
"LineCount": 30
}Results: {
"Contents": " 445:\t\tif (dev-\u003edriver) {\n 446:\t\t\tconst struct spi_driver\t*sdrv = to_spi_driver(dev-\u003edriver);\n 447:\t\n 448:\t\t\tif (sdrv-\u003eshutdown)\n 449:\t\t\t\tsdrv-\u003eshutdown(to_spi_device(dev));\n 450:\t\t}\n 451:\t}\n 452:\t\n 453:\tconst struct bus_type spi_bus_type = {\n 454:\t\t.name\t\t= \"spi\",\n 455:\t\t.dev_groups\t= spi_dev_groups,\n 456:\t\t.match\t\t= spi_match_device,\n 457:\t\t.uevent\t\t= spi_uevent,\n 458:\t\t.probe\t\t= spi_probe,\n 459:\t\t.remove\t\t= spi_remove,\n 460:\t\t.shutdown\t= spi_shutdown,\n 461:\t};\n 462:\tEXPORT_SYMBOL_GPL(spi_bus_type);\n 463:\t\n 464:\t/**\n 465:\t * __spi_register_driver - register a SPI driver\n 466:\t * @owner: owner module of the driver to register\n 467:\t * @sdrv: the driver to register\n 468:\t * Context: can sleep\n 469:\t *\n 470:\t * Return: zero on success, else a negative error code.\n 471:\t */\n 472:\tint __spi_register_driver(struct module *owner, struct spi_driver *sdrv)\n 473:\t{\n 474:\t\tsdrv-\u003edriver.owner = owner;\n"
} |
| 41/2 | 2026/09/18 07:48 | llm | patch-evaluator-compressor |
1mModel:gemini-3.8-flash Args: null Results: null Reply: ### Workspace State and Investigation Summary
#### 1. Applied Patch Overview
- **Commit**: `6e6ddfb315700fa441eed8de0ece57875731a24a`
- **Target Arch**: amd64
- **Modified File**: `drivers/iio/adc/ad7768-1.c`
- **Function Modified**: `ad7768_triggered_buffer_alloc(struct iio_dev *indio_dev)`
- **Code Diff**:
```c
@@ -1505,12 +1505,16 @@ static int ad7768_triggered_buffer_alloc(struct iio_dev *indio_dev)
if (ret)
return ret;
+ ret = devm_iio_triggered_buffer_setup(indio_dev->dev.parent, indio_dev,
+ &iio_pollfunc_store_time,
+ &ad7768_trigger_handler,
+ &ad7768_buffer_ops);
+ if (ret)
+ return ret;
+
indio_dev->trig = iio_trigger_get(st->trig);
- return devm_iio_triggered_buffer_setup(indio_dev->dev.parent, indio_dev,
- &iio_pollfunc_store_time,
- &ad7768_trigger_handler,
- &ad7768_buffer_ops);
+ return 0;
}
```
- **Nature of Change**: Reorders trigger assignment (`indio_dev->trig = iio_trigger_get(st->trig);`) after `devm_iio_triggered_buffer_setup(...)` instead of before it, adding error handling for the buffer setup return code so `iio_trigger_get` isn't leaked on setup failure.
---
#### 2. Approaches Tried & Findings
- **Driver Architecture Analysis**:
- `ad7768-1.c` is an SPI client driver (`module_spi_driver(ad7768_driver)`).
- Probe callback: `ad7768_probe(struct spi_device *spi)`.
- Triggered buffer allocation (`ad7768_triggered_buffer_alloc`) is called only during `ad7768_probe`:
```c
st->offload = devm_spi_offload_get(dev, spi, &ad7768_spi_offload_config);
ret = PTR_ERR_OR_ZERO(st->offload);
if (ret == -ENODEV) {
/* If not using SPI offload, fall back to low speed usage */
ret = ad7768_triggered_buffer_alloc(indio_dev);
...
}
```
- **Reachability Analysis**:
- Device bus: SPI bus (`spi_driver`).
- Unlike I2C (`/sys/bus/i2c/devices/i2c-X/new_device`), the Linux SPI subsystem (`drivers/spi/spi.c`) does NOT export a userspace `new_device` sysfs attribute to instantiate arbitrary SPI client devices.
- Investigated SPI drivers invoking `spi_new_device()`: only hardcoded board/controller code or USB-SPI converters (e.g. `spi-ch341.c` hardcodes `chip.modalias = "spidev"`).
- The driver requires dedicated physical hardware (Analog Devices AD7768-1 / ADAQ7767-1 / ADAQ7768-1 / ADAQ7769-1 ADC chip) wired via SPI bus with dedicated clock (`mclk`), reference voltage (`vref`), and interrupt line (`spi->irq`), typically described via Devicetree or ACPI.
- Standard virtualized fuzzing environments (QEMU / GCE) do not emulate AD7768 SPI ADC hardware, nor provide a virtual bus mechanism to instantiate `ad7768-1` dynamically without specialized mock/emulation hardware.
---
#### 3. Current Hypotheses & Active Line of Investigation
- **Unreachability / WorthFuzzing=false**:
- Per Core Triage Philosophy Section 1 & Section 2:
- "REACHABILITY IS THE PRIMARY GATE: If the modified code is structurally unreachable... it MUST NOT be fuzzed."
- "Structurally unreachable hardware: ... requiring physical ASIC/PCIe cards not emulated in standard QEMU."
- Code is an SPI device driver for a specific hardware ADC chip with no software emulation, virtual bus instantiation interface, or userspace device creation hook.
- Modified function `ad7768_triggered_buffer_alloc` is called strictly during `.probe` of an uninstantiable physical SPI peripheral.
- Need to finalize whether SPI drivers without virtual bus emulation are classified as `WorthFuzzing=false`.
---
#### 4. Critical File Paths and Configuration Values
- **File**: `drivers/iio/adc/ad7768-1.c`
- **Kconfig**: `drivers/iio/adc/Kconfig`
- Option: `AD7768_1` (depends on `SPI`, `IIO_BUFFER`, etc.)
- **Driver**: `ad7768_driver` (`module_spi_driver`)
- **Key Functions**:
- `ad7768_triggered_buffer_alloc` (modified function)
- `ad7768_probe` (caller at line 1912)
---
#### 5. Potential Reasoning Loops / Pitfalls to Avoid
- Avoid repeating searches for `ad7768` string matches (already performed broad greps returning hundreds of lines of driver definitions).
- Avoid looking for userspace SPI instantiation if none exists in mainline Linux; check if ACPI PRP0001 or configfs overlays exist, but note syzkaller in QEMU/GCE does not configure custom SPI devicetree overlays for arbitrary external ADC chips.
- Prepare to call `set-results` tool directly once reachability determination is confirmed.Tokens: input: 47237 output: 1432 thoughts: 0 |
| 42/2 | 2026/09/18 07:50 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21002 output: 144 thoughts: 470 Thoughts: **My Assessment: AD7768-1 Driver is Structurally Unreachable for Fuzzing** Okay, here's the breakdown of my thinking. The patch targets `drivers/iio/adc/ad7768-1.c`, specifically the `ad7768_triggered_buffer_alloc()` function. I immediately note that this function is only called from `ad7768_probe()`. This driver is an SPI client driver for the Analog Devices AD7768-1 ADC, confirmed by the `module_spi_driver(ad7768_driver)` declaration. Now, here's the critical point. In typical virtualized fuzzing environments like QEMU or GCE, there's *no* hardware emulation for this specific AD7768-1 ADC chip. Unlike I2C, SPI doesn't have a standardized userspace device instantiation method, like `/sys/bus/spi/.../new_device`, nor can it be simulated through typical virtual buses (virtio, USB gadget, netlink, etc.). This means the driver, by its nature as a SPI driver for a physical device, is structurally unreachable in those virtualized environments. This falls directly under the "Structurally unreachable hardware" category defined in Section 2 of our triage philosophy: anything that requires specific, un-emulated hardware. It's the same principle for vendor-specific PCIe switches, SmartNICs, or GPU drivers that depend on specialized hardware not present in the standard fuzzing context. The triage philosophy clearly states that reachability is the primary criterion. We can only fuzz code that *can* execute in these standard virtualized environments. Because the modified code (specifically the `ad7768_probe()` function and by extension, the `ad7768_triggered_buffer_alloc()` function) is structurally unreachable, it MUST NOT be fuzzed, regardless of added assertions or logic. Therefore, my assessment is: * **WorthFuzzing: false** * **EnableConfigs: \[ ]** * **FocusSymbols: \[ ]** The reasoning is straightforward: the AD7768-1 driver is for physical hardware (SPI ADC), and cannot be instantiated or simulated within our standard QEMU/GCE environments; hence, it's unreachable and not suitable for fuzzing. |
| 43/2 | 2026/09/18 07:50 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies ad7768_triggered_buffer_alloc() in drivers/iio/adc/ad7768-1.c, which is only executed during the probe sequence of the AD7768-1 SPI ADC driver. This driver targets physical Analog Devices ADC hardware and requires dedicated physical SPI wiring, clocks, and interrupt lines. In standard virtualized environments (QEMU/GCE), no software emulation or dynamic userspace instantiation mechanism exists for this SPI device, rendering the modified code structurally unreachable for fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies ad7768_triggered_buffer_alloc() in drivers/iio/adc/ad7768-1.c, which is only executed during the probe sequence of the AD7768-1 SPI ADC driver. This driver targets physical Analog Devices ADC hardware and requires dedicated physical SPI wiring, clocks, and interrupt lines. In standard virtualized environments (QEMU/GCE), no software emulation or dynamic userspace instantiation mechanism exists for this SPI device, rendering the modified code structurally unreachable for fuzzing.",
"WorthFuzzing": false
} |
| 44/1 | 2026/09/18 07:50 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|