[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211020217.BxZhIANd-lkp@intel.com>
Date: Wed, 2 Nov 2022 02:21:30 +0800
From: kernel test robot <lkp@...el.com>
To: glazveze@...ta.nl, linux-rtc@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev,
Mike Looijmans <mike.looijmans@...ic.nl>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] rtc: ds1307: Add support for Epson RX8111
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on linus/master v6.1-rc3 next-20221101]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/glazveze-delta-nl/dt-bindings-rtc-ds1307-Add-support-for-Epson-RX8111/20221101-180204
base: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
patch link: https://lore.kernel.org/r/20221101083123.11695-2-glazveze%40delta.nl
patch subject: [PATCH v2 2/2] rtc: ds1307: Add support for Epson RX8111
config: powerpc-allmodconfig
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/aa40485d8590c106bf51d00bcbee26aab0f389b8
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review glazveze-delta-nl/dt-bindings-rtc-ds1307-Add-support-for-Epson-RX8111/20221101-180204
git checkout aa40485d8590c106bf51d00bcbee26aab0f389b8
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
drivers/rtc/rtc-ds1307.c: In function 'ds1307_probe':
>> drivers/rtc/rtc-ds1307.c:2220:28: error: 'struct rtc_device' has no member named 'uie_unsupported'
2220 | ds1307->rtc->uie_unsupported = 1;
| ^~
vim +2220 drivers/rtc/rtc-ds1307.c
1970
1971 static int ds1307_probe(struct i2c_client *client,
1972 const struct i2c_device_id *id)
1973 {
1974 struct ds1307 *ds1307;
1975 const void *match;
1976 int err = -ENODEV;
1977 int tmp;
1978 const struct chip_desc *chip;
1979 bool want_irq;
1980 bool ds1307_can_wakeup_device = false;
1981 unsigned char regs[8];
1982 struct ds1307_platform_data *pdata = dev_get_platdata(&client->dev);
1983 u8 trickle_charger_setup = 0;
1984
1985 ds1307 = devm_kzalloc(&client->dev, sizeof(struct ds1307), GFP_KERNEL);
1986 if (!ds1307)
1987 return -ENOMEM;
1988
1989 dev_set_drvdata(&client->dev, ds1307);
1990 ds1307->dev = &client->dev;
1991 ds1307->name = client->name;
1992
1993 ds1307->regmap = devm_regmap_init_i2c(client, ®map_config);
1994 if (IS_ERR(ds1307->regmap)) {
1995 dev_err(ds1307->dev, "regmap allocation failed\n");
1996 return PTR_ERR(ds1307->regmap);
1997 }
1998
1999 i2c_set_clientdata(client, ds1307);
2000
2001 match = device_get_match_data(&client->dev);
2002 if (match) {
2003 ds1307->type = (enum ds_type)match;
2004 chip = &chips[ds1307->type];
2005 } else if (id) {
2006 chip = &chips[id->driver_data];
2007 ds1307->type = id->driver_data;
2008 } else {
2009 return -ENODEV;
2010 }
2011
2012 want_irq = client->irq > 0 && chip->alarm;
2013
2014 if (!pdata)
2015 trickle_charger_setup = ds1307_trickle_init(ds1307, chip);
2016 else if (pdata->trickle_charger_setup)
2017 trickle_charger_setup = pdata->trickle_charger_setup;
2018
2019 if (trickle_charger_setup && chip->trickle_charger_reg) {
2020 dev_dbg(ds1307->dev,
2021 "writing trickle charger info 0x%x to 0x%x\n",
2022 trickle_charger_setup, chip->trickle_charger_reg);
2023 regmap_write(ds1307->regmap, chip->trickle_charger_reg,
2024 trickle_charger_setup);
2025 }
2026
2027 /*
2028 * For devices with no IRQ directly connected to the SoC, the RTC chip
2029 * can be forced as a wakeup source by stating that explicitly in
2030 * the device's .dts file using the "wakeup-source" boolean property.
2031 * If the "wakeup-source" property is set, don't request an IRQ.
2032 * This will guarantee the 'wakealarm' sysfs entry is available on the device,
2033 * if supported by the RTC.
2034 */
2035 if (chip->alarm && device_property_read_bool(&client->dev, "wakeup-source"))
2036 ds1307_can_wakeup_device = true;
2037
2038 switch (ds1307->type) {
2039 case ds_1337:
2040 case ds_1339:
2041 case ds_1341:
2042 case ds_3231:
2043 /* get registers that the "rtc" read below won't read... */
2044 err = regmap_bulk_read(ds1307->regmap, DS1337_REG_CONTROL,
2045 regs, 2);
2046 if (err) {
2047 dev_dbg(ds1307->dev, "read error %d\n", err);
2048 goto exit;
2049 }
2050
2051 /* oscillator off? turn it on, so clock can tick. */
2052 if (regs[0] & DS1337_BIT_nEOSC)
2053 regs[0] &= ~DS1337_BIT_nEOSC;
2054
2055 /*
2056 * Using IRQ or defined as wakeup-source?
2057 * Disable the square wave and both alarms.
2058 * For some variants, be sure alarms can trigger when we're
2059 * running on Vbackup (BBSQI/BBSQW)
2060 */
2061 if (want_irq || ds1307_can_wakeup_device) {
2062 regs[0] |= DS1337_BIT_INTCN | chip->bbsqi_bit;
2063 regs[0] &= ~(DS1337_BIT_A2IE | DS1337_BIT_A1IE);
2064 }
2065
2066 regmap_write(ds1307->regmap, DS1337_REG_CONTROL,
2067 regs[0]);
2068
2069 /* oscillator fault? clear flag, and warn */
2070 if (regs[1] & DS1337_BIT_OSF) {
2071 regmap_write(ds1307->regmap, DS1337_REG_STATUS,
2072 regs[1] & ~DS1337_BIT_OSF);
2073 dev_warn(ds1307->dev, "SET TIME!\n");
2074 }
2075 break;
2076
2077 case rx_8025:
2078 err = regmap_bulk_read(ds1307->regmap,
2079 RX8025_REG_CTRL1 << 4 | 0x08, regs, 2);
2080 if (err) {
2081 dev_dbg(ds1307->dev, "read error %d\n", err);
2082 goto exit;
2083 }
2084
2085 /* oscillator off? turn it on, so clock can tick. */
2086 if (!(regs[1] & RX8025_BIT_XST)) {
2087 regs[1] |= RX8025_BIT_XST;
2088 regmap_write(ds1307->regmap,
2089 RX8025_REG_CTRL2 << 4 | 0x08,
2090 regs[1]);
2091 dev_warn(ds1307->dev,
2092 "oscillator stop detected - SET TIME!\n");
2093 }
2094
2095 if (regs[1] & RX8025_BIT_PON) {
2096 regs[1] &= ~RX8025_BIT_PON;
2097 regmap_write(ds1307->regmap,
2098 RX8025_REG_CTRL2 << 4 | 0x08,
2099 regs[1]);
2100 dev_warn(ds1307->dev, "power-on detected\n");
2101 }
2102
2103 if (regs[1] & RX8025_BIT_VDET) {
2104 regs[1] &= ~RX8025_BIT_VDET;
2105 regmap_write(ds1307->regmap,
2106 RX8025_REG_CTRL2 << 4 | 0x08,
2107 regs[1]);
2108 dev_warn(ds1307->dev, "voltage drop detected\n");
2109 }
2110
2111 /* make sure we are running in 24hour mode */
2112 if (!(regs[0] & RX8025_BIT_2412)) {
2113 u8 hour;
2114
2115 /* switch to 24 hour mode */
2116 regmap_write(ds1307->regmap,
2117 RX8025_REG_CTRL1 << 4 | 0x08,
2118 regs[0] | RX8025_BIT_2412);
2119
2120 err = regmap_bulk_read(ds1307->regmap,
2121 RX8025_REG_CTRL1 << 4 | 0x08,
2122 regs, 2);
2123 if (err) {
2124 dev_dbg(ds1307->dev, "read error %d\n", err);
2125 goto exit;
2126 }
2127
2128 /* correct hour */
2129 hour = bcd2bin(regs[DS1307_REG_HOUR]);
2130 if (hour == 12)
2131 hour = 0;
2132 if (regs[DS1307_REG_HOUR] & DS1307_BIT_PM)
2133 hour += 12;
2134
2135 regmap_write(ds1307->regmap,
2136 DS1307_REG_HOUR << 4 | 0x08, hour);
2137 }
2138 break;
2139 case rx_8111:
2140 /* Use memory as user RAM */
2141 regmap_write(ds1307->regmap, RX8111_REG_TIME_STAMP_BUF_CTRL, 0);
2142 /* Disable timer, events, frequency output */
2143 regmap_write(ds1307->regmap, RX8111_REG_EXTENSION, 0xc8);
2144 break;
2145 case ds_1388:
2146 err = regmap_read(ds1307->regmap, DS1388_REG_CONTROL, &tmp);
2147 if (err) {
2148 dev_dbg(ds1307->dev, "read error %d\n", err);
2149 goto exit;
2150 }
2151
2152 /* oscillator off? turn it on, so clock can tick. */
2153 if (tmp & DS1388_BIT_nEOSC) {
2154 tmp &= ~DS1388_BIT_nEOSC;
2155 regmap_write(ds1307->regmap, DS1388_REG_CONTROL, tmp);
2156 }
2157 break;
2158 default:
2159 break;
2160 }
2161
2162 /* read RTC registers */
2163 err = regmap_bulk_read(ds1307->regmap, chip->offset, regs,
2164 sizeof(regs));
2165 if (err) {
2166 dev_dbg(ds1307->dev, "read error %d\n", err);
2167 goto exit;
2168 }
2169
2170 if (ds1307->type == mcp794xx &&
2171 !(regs[DS1307_REG_WDAY] & MCP794XX_BIT_VBATEN)) {
2172 regmap_write(ds1307->regmap, DS1307_REG_WDAY,
2173 regs[DS1307_REG_WDAY] |
2174 MCP794XX_BIT_VBATEN);
2175 }
2176
2177 tmp = regs[DS1307_REG_HOUR];
2178 switch (ds1307->type) {
2179 case ds_1340:
2180 case m41t0:
2181 case m41t00:
2182 case m41t11:
2183 /*
2184 * NOTE: ignores century bits; fix before deploying
2185 * systems that will run through year 2100.
2186 */
2187 break;
2188 case rx_8025:
2189 break;
2190 default:
2191 if (!(tmp & DS1307_BIT_12HR))
2192 break;
2193
2194 /*
2195 * Be sure we're in 24 hour mode. Multi-master systems
2196 * take note...
2197 */
2198 tmp = bcd2bin(tmp & 0x1f);
2199 if (tmp == 12)
2200 tmp = 0;
2201 if (regs[DS1307_REG_HOUR] & DS1307_BIT_PM)
2202 tmp += 12;
2203 regmap_write(ds1307->regmap, chip->offset + DS1307_REG_HOUR,
2204 bin2bcd(tmp));
2205 }
2206
2207 ds1307->rtc = devm_rtc_allocate_device(ds1307->dev);
2208 if (IS_ERR(ds1307->rtc))
2209 return PTR_ERR(ds1307->rtc);
2210
2211 if (want_irq || ds1307_can_wakeup_device)
2212 device_set_wakeup_capable(ds1307->dev, true);
2213 else
2214 clear_bit(RTC_FEATURE_ALARM, ds1307->rtc->features);
2215
2216 if (ds1307_can_wakeup_device && !want_irq) {
2217 dev_info(ds1307->dev,
2218 "'wakeup-source' is set, request for an IRQ is disabled!\n");
2219 /* We cannot support UIE mode if we do not have an IRQ line */
> 2220 ds1307->rtc->uie_unsupported = 1;
2221 }
2222
2223 if (want_irq) {
2224 err = devm_request_threaded_irq(ds1307->dev, client->irq, NULL,
2225 chip->irq_handler ?: ds1307_irq,
2226 IRQF_SHARED | IRQF_ONESHOT,
2227 ds1307->name, ds1307);
2228 if (err) {
2229 client->irq = 0;
2230 device_set_wakeup_capable(ds1307->dev, false);
2231 clear_bit(RTC_FEATURE_ALARM, ds1307->rtc->features);
2232 dev_err(ds1307->dev, "unable to request IRQ!\n");
2233 } else {
2234 dev_dbg(ds1307->dev, "got IRQ %d\n", client->irq);
2235 }
2236 }
2237
2238 ds1307->rtc->ops = chip->rtc_ops ?: &ds13xx_rtc_ops;
2239 err = ds1307_add_frequency_test(ds1307);
2240 if (err)
2241 return err;
2242
2243 err = devm_rtc_register_device(ds1307->rtc);
2244 if (err)
2245 return err;
2246
2247 if (chip->nvram_size) {
2248 struct nvmem_config nvmem_cfg = {
2249 .name = "ds1307_nvram",
2250 .word_size = 1,
2251 .stride = 1,
2252 .size = chip->nvram_size,
2253 .reg_read = ds1307_nvram_read,
2254 .reg_write = ds1307_nvram_write,
2255 .priv = ds1307,
2256 };
2257
2258 devm_rtc_nvmem_register(ds1307->rtc, &nvmem_cfg);
2259 }
2260
2261 ds1307_hwmon_register(ds1307);
2262 ds1307_clks_register(ds1307);
2263 ds1307_wdt_register(ds1307);
2264
2265 return 0;
2266
2267 exit:
2268 return err;
2269 }
2270
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (323443 bytes)
Powered by blists - more mailing lists