> On 10/12/2024 18:45, Johnny Liu wrote: > > > + > > +static int host1x_actmon_sample_period_set(void *data, u64 val) > > +{ > > + struct host1x_actmon *actmon = (struct host1x_actmon *)data; > > + > > + actmon->usecs_per_sample = (u32)val; > > + host1x_actmon_update_sample_period(actmon); > > + > > + return 0; > > +} > > + > > +DEFINE_SIMPLE_ATTRIBUTE(host1x_actmon_sample_period_fops, > > + host1x_actmon_sample_period_get, > > + host1x_actmon_sample_period_set, > > + "%lld\n"); > > + > > +/** > > + * host1x_actmon_debug_init - Initialize actmon debugfs > > > No, debugfs is only for debugging, not for usual interfaces. You now > added several driver knobs bypassing any ABI documentation. Thank you for pointing out the issue. I will expose these control interfaces under sysfs, probably hwmon, in the next patch series. > > + * @actmon: the actmon instance being configured > > + * @name: an unique name of the actmon > > + * > > + * There are multiple modules available inside the actmon, and they perform the > > + * signal sampling at the same rate. The debugfs of an actmon will expose this > > + * shared configuration, sample_period, via a debugfs node: > > + * - sample_period: > > + * Sampling period in micro-second of modules inside the actmon > > + */ > > +static void host1x_actmon_debug_init(struct host1x_actmon *actmon, const char *name) > > +{ > > + struct host1x *host = dev_get_drvdata(actmon->client->host->parent); > > + > > + if (!host->debugfs) { > > + dev_warn(host->dev, "debugfs is unavailable\n"); > > + return; > > + } > > + > > + if (!host->actmon_debugfs) > > + host->actmon_debugfs = debugfs_create_dir("actmon", host->debugfs); > > + > > + actmon->debugfs = debugfs_create_dir(name, host->actmon_debugfs); > > + > > + /* R/W files */ > > + debugfs_create_file("sample_period", 0644, actmon->debugfs, actmon, > > + &host1x_actmon_sample_period_fops); > > +} > > + Thanks, Johnny