Skip to content

Commit 3c4077d

Browse files
NET:ETH:ALTERA: DPLL files repositioning
1 parent d9cf69e commit 3c4077d

13 files changed

+47
-29
lines changed

drivers/net/ethernet/altera/intel_freq_ctrl_common_i2c.c renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_common_i2c.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*/
88

9-
#include "intel_freq_control.h"
9+
#include "../intel_freq_control.h"
1010
#include "intel_freq_ctrl_common_i2c.h"
1111

1212
int determine_i2c_client(struct clock_cleaner *clockcleaner_info)
@@ -18,10 +18,10 @@ int determine_i2c_client(struct clock_cleaner *clockcleaner_info)
1818
int ret = FREQ_CTRL_ERROR_FAIL;
1919
const char *type;
2020
struct i2c_client *i2c_cli;
21-
struct intel_freq_control_private *priv =
22-
container_of(clockcleaner_info,
23-
struct intel_freq_control_private,
24-
clockcleaner_info);
21+
struct intel_freq_control_private *priv =
22+
container_of (clockcleaner_info,
23+
struct intel_freq_control_private,
24+
clockcleaner_info);
2525

2626
i2c_cli = priv->fc_acc_type.i2c_cli;
2727

@@ -45,12 +45,12 @@ int determine_i2c_client(struct clock_cleaner *clockcleaner_info)
4545
ret = FREQ_CTRL_ERROR_FAIL;
4646
goto i2c_client_ret;
4747
}
48-
48+
4949
memset(&i2c_info, 0, sizeof(struct i2c_board_info));
5050
strscpy(i2c_info.type, type, I2C_NAME_SIZE);
5151
i2c_info.addr = addr;
5252
i2c_cli = i2c_new_client_device(i2c_adap, &i2c_info);
53-
53+
5454
if (IS_ERR(i2c_cli)) {
5555
pr_err("can't create i2c device %s\n", i2c_info.type);
5656
ret = FREQ_CTRL_ERROR_FAIL;
@@ -62,5 +62,5 @@ int determine_i2c_client(struct clock_cleaner *clockcleaner_info)
6262
goto i2c_client_ret;
6363
}
6464
i2c_client_ret:
65-
return ret;
65+
return ret;
6666
}

drivers/net/ethernet/altera/intel_freq_ctrl_common_i2c.h renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_common_i2c.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* SPDX-License-Identifier: GPL */
2-
/* Copyright (C) 2023 Intel Corporation. All rights reserved.
1+
// SPDX-License-Identifier: GPL
2+
/* Copyright (C) 2023 Intel Corporation. All rights reserved.
33
*
44
* Author(s):
55
*/
@@ -11,7 +11,6 @@
1111
#include <linux/i2c.h>
1212

1313
struct clock_cleaner;
14-
int determine_i2c_client(struct clock_cleaner *clockcleaner_info);
15-
16-
#endif
14+
int determine_i2c_client(struct clock_cleaner *);
1715

16+
#endif

drivers/net/ethernet/altera/intel_freq_ctrl_common_spi.c renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_common_spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*/
99

10-
#include "intel_freq_control.h"
10+
#include "../intel_freq_control.h"
1111
#include "intel_freq_ctrl_common_spi.h"
1212

1313
static int spi_dev_check(struct device *dev, void *data)
@@ -30,7 +30,7 @@ static int spi_dev_check(struct device *dev, void *data)
3030
}
3131

3232
if ((clockcleaner_info->bus_num != spi->controller->bus_num) ||
33-
(clockcleaner_info->chip_select != spi->chip_select)) {
33+
(clockcleaner_info->chip_select != spi_get_chipselect(spi, 0))) {
3434
ret = INTEL_FPGA_SPI_ERROR;
3535
goto spi_client_ret;
3636
}

drivers/net/ethernet/altera/intel_freq_ctrl_common_spi.h renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_common_spi.h

File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/* Intel FPGA Clock Cleaner Frequency Adjustment Driver
3+
* Copyright (C) 2023 Intel Corporation. All rights reserved.
4+
*
5+
* Author(s):
6+
* Lubana Badakar <[email protected]>
7+
*/
8+
9+
#ifndef HAVE_INTEL_FREQUENCY_CONTROL_ZL30733_H
10+
#define HAVE_INTEL_FREQUENCY_CONTROL_ZL30733_H
11+
12+
13+
int zl30733_sysfs_configure(struct i2c_client *i2c_cli);
14+
u8 i2c_zl30733_write_byte_data(const struct i2c_client *client, u16 reg, u8 data[], u8 data_len);
15+
u8 i2c_zl30733_read_byte_data(const struct i2c_client *client, u16 reg, u8 *buf, u8 data_len);
16+
17+
#endif //HAVE_INTEL_FREQUENCY_CONTROL_ZL30793_H

drivers/net/ethernet/altera/intel_freq_control_zl30733_debugfs.c renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_zl30733_debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <linux/i2c.h>
1515
#include <linux/kernel.h>
1616
#include <linux/debugfs.h>
17-
#include "intel_freq_control.h"
17+
#include "../intel_freq_control.h"
1818
#include "intel_freq_ctrl_zl30733_i2c.h"
19-
#include "intel_freq_control_zl30733_debugfs.h"
19+
#include "intel_freq_ctrl_zl30733_debugfs.h"
2020

2121
/* Register Map Page 0, General */
2222
u16 zl30733_reg_page_0[] = {

drivers/net/ethernet/altera/intel_freq_control_zl30733_debugfs.h renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_zl30733_debugfs.h

File renamed without changes.

drivers/net/ethernet/altera/intel_freq_ctrl_zl30733_i2c.c renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_zl30733_i2c.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: GPL-2.0
1+
// SPDX-License-Identifier: GPL
22
/* Intel zarlink i2c driver
33
* Copyright (C) 2023 Intel Corporation. All rights reserved
44
*
@@ -16,8 +16,8 @@
1616
#include <linux/module.h>
1717
#include <linux/workqueue.h>
1818
#include <linux/spi/spi.h>
19-
#include "intel_freq_control.h"
20-
#include "intel_freq_control_zl30733_debugfs.h"
19+
#include "../intel_freq_control.h"
20+
#include "intel_freq_ctrl_zl30733_debugfs.h"
2121
#include "intel_freq_ctrl_zl30733_i2c.h"
2222

2323
u8 i2c_zl30733_write_byte_data(const struct i2c_client *client, u16 reg, u8 data[], u8 data_len)
@@ -178,9 +178,9 @@ void intel_freq_control_zl30733(struct work_struct *work)
178178
&data[i], 1);
179179
}
180180
pr_devel("%s:ZL30733 scaled ppm %lx writing data %x-%x-%x-%x-%x-%x in work queue",
181-
__func__, scaled_ppm, data[0], data[1], data[2],
182-
data[3], data[4], data[5]);
181+
__func__, scaled_ppm, data[0], data[1], data[2], data[3], data[4], data[5]);
183182
}
183+
//(void)i2c_zl30733_write_byte_data(i2c_cli, ZL30733_REG_DPLL_DF_OFFSET_0_0, data, 6);
184184
}
185185

186186
static int zl30733_dpll_nco_modeset(struct i2c_client *i2c_cli)
@@ -250,6 +250,7 @@ static void pll_lock_handler(struct work_struct *work)
250250
}
251251
}
252252

253+
253254
int i2c_dev_check_zl30733_clock(struct intel_freq_control_private *priv)
254255
{
255256
struct i2c_client *i2c_cli = NULL;
@@ -267,13 +268,15 @@ int i2c_dev_check_zl30733_clock(struct intel_freq_control_private *priv)
267268

268269
if (((rdbuf[0] << 8) | rdbuf[1]) == ZL30733_ID_VALUE) {
269270
#ifdef CONFIG_DEBUG_FS
270-
priv->pll_dbg = zl30733_dbgfs_init(i2c_cli);
271+
zl30733_dbgfs_init(i2c_cli);
271272
#endif
272273
priv->pll_lock_check_ctr = 0;
273274
INIT_DELAYED_WORK(&priv->pll_lock_dwork, pll_lock_handler);
274275
schedule_delayed_work(&priv->pll_lock_dwork,
275276
msecs_to_jiffies(1));
277+
276278
}
277279
}
280+
278281
return ret;
279282
}

drivers/net/ethernet/altera/intel_freq_ctrl_zl30733_i2c.h renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_zl30733_i2c.h

File renamed without changes.

drivers/net/ethernet/altera/intel_freq_control_zl30793.c renamed to drivers/net/ethernet/altera/dpll/intel_freq_ctrl_zl30793.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/module.h>
1616
#include <linux/workqueue.h>
1717
#include <linux/spi/spi.h>
18-
#include "intel_freq_control_zl30793.h"
18+
#include "intel_freq_ctrl_zl30793.h"
1919

2020
/* Register Map Page 0, General */
2121
u16 zl30793_reg_page_0[] = {
@@ -478,7 +478,7 @@ static DEVICE_ATTR(zl30793_dpll_manual_freq_offset, 0644,
478478
zl30793_dpll_manual_freq_offset_show,
479479
zl30793_dpll_manual_freq_offset_store);
480480

481-
static DEVICE_ATTR_RO(zl30793_reg_dump);
481+
static DEVICE_ATTR(zl30793_reg_dump, 0444, zl30793_reg_dump_show, NULL);
482482

483483
static struct attribute *zl30793_sysfs_attrs[] = {
484484
&dev_attr_zl30793_dpll_manual_freq_offset.attr,

0 commit comments

Comments
 (0)